MPHIBERNATE-13: new class necessary to implement hibernate:schema-update

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116207 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
felipeal committed 2004-11-06 21:51:31 +00:00
1 parent aaf0dbd534
commit 6d3a269221
2 files changed
+88

No files matched your search

@@ -0,0 +1,52 @@
package org.apache.maven.hibernate.beans;
/* ====================================================================
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
import java.io.FileInputStream;
import java.util.Properties;
import net.sf.hibernate.cfg.Configuration;
import net.sf.hibernate.tool.hbm2ddl.SchemaUpdate;
/**
*
* The Bean which serves as Proxy To Hibernate SchemaUpdate
* <br/>
*
* @author <a href="maven@felipeal.net">Felipe Leme</a>
* @version $Id: SchemaUpdateBean.java,v 1.1 2004/11/06 21:51:31 felipeal Exp $
*/
public class SchemaUpdateBean extends SchemaBeanBase
{
protected void executeSchema(Configuration cfg) throws Exception {
SchemaUpdate schemaUpdate = null;
if (getProperties() == null)
{
schemaUpdate = new SchemaUpdate(cfg);
}
else
{
Properties properties = new Properties();
properties.load(new FileInputStream(getProperties()));
schemaUpdate = new SchemaUpdate(cfg, properties);
}
schemaUpdate.execute( !getQuiet(), !getText() );
}
}
@@ -0,0 +1,36 @@
package org.apache.maven.hibernate.jelly;
/* ====================================================================
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
import org.apache.maven.hibernate.beans.SchemaUpdateBean;
/**
*
* Jelly tag which delagates all calls to {@link SchemaUpdateBean}
*
* @author <a href="maven@felipeal.net">Felipe Leme</a>
* @version $Id: SchemaUpdateTag.java,v 1.1 2004/11/06 21:51:31 felipeal Exp $
*/
public class SchemaUpdateTag extends SchemaTagBase
{
public SchemaUpdateTag() {
super( new SchemaUpdateBean() );
}
}