Repository: empire-db Updated Branches: refs/heads/master 46d3e32e2 -> 83302f083
http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/icons/logo.png ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/icons/logo.png b/empire-db-eclipse-codegen/src/main/resources/icons/logo.png new file mode 100644 index 0000000..5be2395 Binary files /dev/null and b/empire-db-eclipse-codegen/src/main/resources/icons/logo.png differ http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/icons/save.png ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/icons/save.png b/empire-db-eclipse-codegen/src/main/resources/icons/save.png new file mode 100644 index 0000000..3f7664f Binary files /dev/null and b/empire-db-eclipse-codegen/src/main/resources/icons/save.png differ http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/icons/testConnection.gif ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/icons/testConnection.gif b/empire-db-eclipse-codegen/src/main/resources/icons/testConnection.gif new file mode 100644 index 0000000..864034f Binary files /dev/null and b/empire-db-eclipse-codegen/src/main/resources/icons/testConnection.gif differ http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/icons/uncheck_all.gif ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/icons/uncheck_all.gif b/empire-db-eclipse-codegen/src/main/resources/icons/uncheck_all.gif new file mode 100644 index 0000000..f6b9f8a Binary files /dev/null and b/empire-db-eclipse-codegen/src/main/resources/icons/uncheck_all.gif differ http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/lang/messages_en.properties ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/lang/messages_en.properties b/empire-db-eclipse-codegen/src/main/resources/lang/messages_en.properties new file mode 100644 index 0000000..b4ffc89 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/lang/messages_en.properties @@ -0,0 +1,141 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# +dialog.title=Empire db tool +dialog.ok=Create entities +dialog.next=Next +dialog.back=Back +dialog.close=Close +dialog.errorFieldRequired=Field required +dialog.errorFieldRequired.msg=Field {0} is required. Please fill it out. +dialog.delete=Delete configuration +dialog.delete.msg=Do you really want to delete this configuration? +dialog.save=Save configuration +dialog.save.msg=Do you want to save the current configuration? +dialog.passwordMismatch=Password mismatch +dialog.passwordMismatch.msg=The password does not match! +dialog.tables.title=Table selection +dialog.tables.discription=Select the tables to create +dialog.tables.connect=Connect database +dialog.tables.finish=OK + +existingConfigs=Existing configurations +configTitle=Config title +dbConnection=Database connection: +dbConnectionType=Connection Type +testConnection=Test connection +dbServer=Database server +dbPort=Database port +dbSid=Database name +jdbcUser=Database username +jdbcPassword=Database password +jdbcPasswordConfirm=Confirm password +connectionFailed=Connection failed! +connectionSuccess=Connection success! +dbTablePattern=Table pattern +targetFolder=Target folder +packageName=Package name +tablePackageName=Table package name +viewPackageName=View package name +recordPackageName=Record package name +dbClassName=Database class name +tableBaseName=Table base name +viewBaseName=View base name +recordBaseName=Record base name +tableNamePrefix=Table prefix +requiredParams=Package parameter: +targetFolder=Target folder +packageName=Package name +tablePackageName=Table package name +viewPackageName=View package name +recordPackageName=Record package name + +# class name config +classParameter=Class name configuration: +dbClassName=Database class name +tableBaseName=Table base name +viewBaseName=View base name +recordBaseName=Record base name +tableNamePrefix=Table name prefix +tableClassPrefix=Table class prefix +tableClassSuffix=Table class suffix +viewNamePrefix=View name prefix +viewClassPrefix=View class prefix +viewClassSuffix=View class suffix +columnNamePrefix=Column name prefix + +# schema options +schemaOptions=Schema options: +dbCatalog=Catalog name +dbSchema=Schema +timestampColumn=Timestamp Column name +flagGroup=Misc +nestTables=Nest tables +nestViews=Nest views +createRecordProperties=Create Record Properties +preserverCharCase=Preserver char case +preserveRelationNames=Preserve relation names +############################################## +# tool tips +############################################## +tooltip.testConnection=Test your current connection configuration +tooltip.dbConnectionType= +tooltip.dbServer= +tooltip.dbPort= +tooltip.dbSid= +tooltip.jdbcUser= +tooltip.jdbcPassword= +tooltip.jdbcPasswordConfirm= +tooltip.dbTablePattern= +tooltip.targetFolder= +tooltip.packageName= +tooltip.tablePackageName= +tooltip.viewPackageName= +tooltip.recordPackageName= +tooltip.dbClassName= +tooltip.tableBaseName= +tooltip.viewBaseName= +tooltip.recordBaseName= +tooltip.tableNamePrefix= +tooltip.targetFolder= +tooltip.packageName= +tooltip.tablePackageName= +tooltip.viewPackageName= +tooltip.recordPackageName= + +# class name config +tooltip.dbClassName=Name of the generated database class. This class extends DBDatabase. +tooltip.tableBaseName=Target name of the generated table class. This class extends DBTable and is the base class for all generated individual table classes. +tooltip.viewBaseName=Target name of the generated view class. This class extends DBView and is the base class for all generated individual view classes. +tooltip.recordBaseName= +tooltip.tableNamePrefix= +tooltip.tableClassPrefix= +tooltip.tableClassSuffix= +tooltip.viewNamePrefix= +tooltip.viewClassPrefix= +tooltip.viewClassSuffix= +tooltip.columnNamePrefix= + +# schema options +tooltip.dbCatalog=name of the database catalog. +tooltip.dbSchema=name of the database schema. +tooltip.timestampColumn=name of the table pattern. +tooltip.nestTables=if TRUE table classes should be declared as inner classes of DBDatabase.\r\n if FALSE table classes should be declared as top level classes. +tooltip.nestViews=if TRUE view classes should be declared as inner classes of DBDatabase.<br/>if FALSE view classes should be declared as top level classes. +tooltip.createRecordProperties=if TRUE record classes should have a getter and setter for each field.<br/>Otherwise getters / setters are omitted. +tooltip.preserverCharCase= +tooltip.preserveRelationNames= http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/BaseRecord.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/BaseRecord.vm b/empire-db-eclipse-codegen/src/main/resources/templates/BaseRecord.vm new file mode 100644 index 0000000..06b0563 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/BaseRecord.vm @@ -0,0 +1,41 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +package ${recordPackageName}; + +import org.apache.empire.db.DBRecord; +import ${tablePackageName}.${baseTableClassName}; + + +public abstract class ${baseRecordClassName}<T extends ${baseTableClassName}> extends DBRecord { + + private static final long serialVersionUID = 1L; + + public ${baseRecordClassName}(T table) { + super(table); + } + + /** + * Returns the table this record is based upon. + * @return The table this record is based upon. + */ + @SuppressWarnings("unchecked") + public T getTable() { + return (T)super.getRowSet(); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/BaseTable.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/BaseTable.vm b/empire-db-eclipse-codegen/src/main/resources/templates/BaseTable.vm new file mode 100644 index 0000000..83e090c --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/BaseTable.vm @@ -0,0 +1,31 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +package $tablePackageName; + +import org.apache.empire.db.DBDatabase; +import org.apache.empire.db.DBTable; + +public class ${baseTableClassName} extends DBTable { + + private static final long serialVersionUID = 1L; + + public ${baseTableClassName}(String name, DBDatabase db) { + super(name, db); + } +} http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/BaseView.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/BaseView.vm b/empire-db-eclipse-codegen/src/main/resources/templates/BaseView.vm new file mode 100644 index 0000000..c6c934f --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/BaseView.vm @@ -0,0 +1,31 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +package $viewPackageName; + +import org.apache.empire.db.DBDatabase; +import org.apache.empire.db.DBView; + +public abstract class ${baseViewClassName} extends DBView { + + private static final long serialVersionUID = 1L; + + public ${baseViewClassName}(String name, DBDatabase db) { + super(name, db); + } +} http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/Database.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/Database.vm b/empire-db-eclipse-codegen/src/main/resources/templates/Database.vm new file mode 100644 index 0000000..69590a3 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/Database.vm @@ -0,0 +1,136 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +package $basePackageName; + +#if($nestTables == true || $nestViews == true) +import org.apache.empire.data.DataType; +#end +#if($nestViews == true) +import org.apache.empire.db.DBCommandExpr; +#end +import org.apache.empire.db.DBDatabase; +#if($preserveRelationNames == true) +import org.apache.empire.db.DBRelation; +#end +#if($nestTables == true) +import org.apache.empire.db.DBTableColumn; +#end +#if($nestViews == true) +import org.apache.empire.exceptions.NotImplementedException; +#end + +#if($nestTables==false || !($tablePackageName.equalsIgnoreCase($basePackageName))) +import $tablePackageName.*; +// $tablePackageName vs $basePackageName +#end +#if($nestViews==false || ($viewPackageName!=$basePackageName)) +import $viewPackageName.*; +#end + +public class $dbClassName extends DBDatabase { + + private static $dbClassName instance; + private static final long serialVersionUID = 1L; + +#foreach($table in $database.tables) + #set($tblClass=$parser.getTableClassName($table.name)) + public final $tblClass $parser.getTableName($table) = new $tblClass(this); +#end + +#foreach($view in $database.views) + #set($viewClass=$parser.getViewClassName($view.name)) + public final $viewClass $parser.getViewName($view) = new $viewClass(this); +#end + + /** + * Returns the instance of the database. + * @return + */ + public static $dbClassName get() { + if (instance == null) { + instance = new ${dbClassName}(); + } + return instance; + } + + /** + * Default constructor for the $dbClassName. + */ + private ${dbClassName}() { + + #if($preserveRelationNames == true) + // Define foreign key relations +#foreach ($relation in $database.relations) + addRelation("$relation.name", new DBRelation.DBReference[] { +#foreach ($reference in $relation.references) +#if($foreach.isLast()) + ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.${parser.getColumnName($reference.targetColumn)}) }); +#else + ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.${parser.getColumnName($reference.targetColumn)}), +#end +#end +#end + // foreign key relations done + } + #else + // Define foreign key relations +#foreach ($relation in $database.relations) +#if($relation.references.size()==1) +#foreach ($reference in $relation.references) + addRelation( ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.${parser.getColumnName($reference.targetColumn)})); +#end +#else +#foreach ($reference in $relation.references) +#if($foreach.isFirst()) + addRelation( ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.$parser.getColumnName($reference.targetColumn)), +#else +#if($foreach.isLast()) + ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.$parser.getColumnName($reference.targetColumn))); +#else + ${parser.getRowsetName($reference.sourceColumn.rowSet)}.${parser.getColumnName($reference.sourceColumn)}.referenceOn(${parser.getRowsetName($reference.targetColumn.rowSet)}.$parser.getColumnName($reference.targetColumn)), +#end +#end +#end +#end +#end + // foreign key relations done + } +#end + + #if($nestTables == true) + #foreach ($table in $database.tables) + #if ($templateFolder) + #parse( "$templateFolder/Table.vm" ) + #else + #parse( "Table.vm" ) + #end + #end + #end + + #if($nestViews == true) + #foreach ($view in $database.views) + #if ($templateFolder) + #parse( "$templateFolder/View.vm" ) + #else + #parse( "View.vm" ) + #end + #end + #end + +} http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/Record.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/Record.vm b/empire-db-eclipse-codegen/src/main/resources/templates/Record.vm new file mode 100644 index 0000000..a559404 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/Record.vm @@ -0,0 +1,66 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +package ${recordPackageName}; + +#if ($parser.hasBigDecimalField($table)) +import java.math.BigDecimal; +#end + +#if ($parser.hasDateField($table)) +import java.util.Date; +#end + +import ${basePackageName}.${dbClassName}; +import ${recordPackageName}.${baseRecordClassName}; +import ${tablePackageName}.$parser.getTableClassName($table.name); + +/** + * Auto-generated class that represents one record (or row) of data from a + * database table. One of these is generated for each table or view in the + * database. The interface defines getters for auto-generated data (e.g. + * primary key, time stamp field for optimistic locking). It generates both + * getter and setter method for all other columns in the table, with the + * exception of foreign key references. + * + * This class provides protected method that subclasses should use to provide + * access to related records. + */ +public class $parser.getRecordClassName($table.name) extends ${baseRecordClassName}<$parser.getTableClassName($table.name)> { + + private static final long serialVersionUID = 1L; + + public $parser.getRecordClassName($table.name)() { + super(${dbClassName}.get().$parser.getTableName($table)); + } + +#if($createRecordProperties == true) + // Access methods for all columns +#foreach($col in $table.columns) + + public $parser.getJavaType($col).getCanonicalName() $parser.getAccessorName($col)() { + return ($parser.getJavaType($col).getCanonicalName())super.getValue(getTable().${parser.getColumnName($col)}); + } + public void $parser.getMutatorName($col)($parser.getJavaType($col).getCanonicalName() val) { + super.setValue(getTable().${parser.getColumnName($col)}, val); + } +#end +#end + + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/Table.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/Table.vm b/empire-db-eclipse-codegen/src/main/resources/templates/Table.vm new file mode 100644 index 0000000..1193fe8 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/Table.vm @@ -0,0 +1,76 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# +#if($nestTables == false) +package $tablePackageName; + +import org.apache.empire.data.DataType; +import org.apache.empire.db.DBTableColumn; +import $basePackageName.${dbClassName}; +#end + +#if($nestTables == true) + public static class $parser.getTableClassName($table.name) extends ${baseTableClassName} { +#else +public class $parser.getTableClassName($table.name) extends ${baseTableClassName} { +#end + + private static final long serialVersionUID = 1L; + + // define columns +#foreach ($col in $table.columns) + public final DBTableColumn ${parser.getColumnName($col)}; +#end + + public $parser.getTableClassName($table.name)(${dbClassName} db) { + super("$table.name", db); + + // create columns +#foreach ($col in $table.columns) + ${parser.getColumnName($col)} = addColumn("${col.name}", DataType.${parser.getDataType($col)}, ${col.size}, ${col.isRequired()}, ${parser.getDefaultValue($col)}); +#end + + // configure key columns (primary key) +#if($table.keyColumns.size()>0) +#if($table.keyColumns.size()==1) + setPrimaryKey(${parser.getColumnName($table.keyColumns[0])}); +#else + DBTableColumn[] keyColumns = new DBTableColumn[] { +#foreach ($col in $table.keyColumns) +#if($foreach.isLast()==false) + ${parser.getColumnName($col)}, +#else + ${parser.getColumnName($col)} }; + setPrimaryKey(keyColumns); +#end +#end +#end + + // Optimistic locking column +#if($parser.hasLockingColumn($table) == true) + setTimestampColumn(${parser.getColumnName($table.getTimestampColumn())}); +#else + /*no locking column specified*/ +#end +#end + } +#if($nestTables == true) + } +#else +} +#end \ No newline at end of file http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-eclipse-codegen/src/main/resources/templates/View.vm ---------------------------------------------------------------------- diff --git a/empire-db-eclipse-codegen/src/main/resources/templates/View.vm b/empire-db-eclipse-codegen/src/main/resources/templates/View.vm new file mode 100644 index 0000000..0c875b9 --- /dev/null +++ b/empire-db-eclipse-codegen/src/main/resources/templates/View.vm @@ -0,0 +1,68 @@ +#* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + *# + +#if($nestViews == false) +package $viewPackageName; + +import org.apache.empire.data.DataType; +import org.apache.empire.db.DBCommandExpr; +import org.apache.empire.exceptions.NotImplementedException; + +import $basePackageName.${dbClassName}; + +#end + +#if($nestViews == true) + public static class $parser.getViewClassName($view.name) extends ${baseViewClassName} { +#else +public class $parser.getViewClassName($view.name) extends ${baseViewClassName} { +#end + + private static final long serialVersionUID = 1L; + + // define columns +#foreach ($col in $view.columns) + public final DBViewColumn ${parser.getColumnName($col)}; +#end + + public $parser.getViewClassName($view.name)(${dbClassName} db) { + super("$view.name", db); + + // create all columns +#foreach ($col in $view.columns) + ${parser.getColumnName($col)} = super.addColumn("${col.name}", DataType.${col.getDataType()}); +#end + } + + @Override + public DBCommandExpr createCommand() + { + /* + Supply a command for the creation of this view here + or return null to skip view creation + */ + throw new NotImplementedException(this, "createCommand"); + } + +#if($nestViews == true) + } +#else +} +#end + http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/empire-db-example-basic/.gitignore ---------------------------------------------------------------------- diff --git a/empire-db-examples/empire-db-example-basic/.gitignore b/empire-db-examples/empire-db-example-basic/.gitignore index c35a751..86a41ba 100644 --- a/empire-db-examples/empire-db-example-basic/.gitignore +++ b/empire-db-examples/empire-db-example-basic/.gitignore @@ -3,3 +3,4 @@ /.classpath /.project /hsqldb/ +/bin/ http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/empire-db-example-basic/pom.xml ---------------------------------------------------------------------- diff --git a/empire-db-examples/empire-db-example-basic/pom.xml b/empire-db-examples/empire-db-example-basic/pom.xml index 9bc61b2..50d840e 100644 --- a/empire-db-examples/empire-db-example-basic/pom.xml +++ b/empire-db-examples/empire-db-example-basic/pom.xml @@ -34,6 +34,7 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </dependency> + <!-- This dependency should be declared as runtime but the exec plugin is broken atm... --> <dependency> <groupId>hsqldb</groupId> http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/empire-db-example-jsf2/.gitignore ---------------------------------------------------------------------- diff --git a/empire-db-examples/empire-db-example-jsf2/.gitignore b/empire-db-examples/empire-db-example-jsf2/.gitignore index 8bd3a05..f0b1fcf 100644 --- a/empire-db-examples/empire-db-example-jsf2/.gitignore +++ b/empire-db-examples/empire-db-example-jsf2/.gitignore @@ -2,3 +2,4 @@ /.settings/ /.classpath /.project +/.tomcatplugin http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/empire-db-example-struts2-cxf/.gitignore ---------------------------------------------------------------------- diff --git a/empire-db-examples/empire-db-example-struts2-cxf/.gitignore b/empire-db-examples/empire-db-example-struts2-cxf/.gitignore index 8bd3a05..f0b1fcf 100644 --- a/empire-db-examples/empire-db-example-struts2-cxf/.gitignore +++ b/empire-db-examples/empire-db-example-struts2-cxf/.gitignore @@ -2,3 +2,4 @@ /.settings/ /.classpath /.project +/.tomcatplugin http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/empire-db-example-struts2/.gitignore ---------------------------------------------------------------------- diff --git a/empire-db-examples/empire-db-example-struts2/.gitignore b/empire-db-examples/empire-db-example-struts2/.gitignore index 8bd3a05..f0b1fcf 100644 --- a/empire-db-examples/empire-db-example-struts2/.gitignore +++ b/empire-db-examples/empire-db-example-struts2/.gitignore @@ -2,3 +2,4 @@ /.settings/ /.classpath /.project +/.tomcatplugin http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-examples/pom.xml ---------------------------------------------------------------------- diff --git a/empire-db-examples/pom.xml b/empire-db-examples/pom.xml index bd6274c..8f17974 100644 --- a/empire-db-examples/pom.xml +++ b/empire-db-examples/pom.xml @@ -27,16 +27,6 @@ <name>Apache Empire-db Examples</name> <dependencies> <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.0.4</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.14</version> - </dependency> - <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> </dependency> http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/empire-db-maven-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/empire-db-maven-plugin/pom.xml b/empire-db-maven-plugin/pom.xml index 9bb60f5..135a943 100644 --- a/empire-db-maven-plugin/pom.xml +++ b/empire-db-maven-plugin/pom.xml @@ -59,12 +59,12 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.0.4</version> + <version>1.1.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - <version>1.2.14</version> + <version>1.2.16</version> </dependency> <dependency> <groupId>junit</groupId> http://git-wip-us.apache.org/repos/asf/empire-db/blob/83302f08/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index c4a701a..6ba163f 100644 --- a/pom.xml +++ b/pom.xml @@ -44,8 +44,8 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <maven.compile.source>1.5</maven.compile.source> - <maven.compile.target>1.5</maven.compile.target> + <maven.compile.source>1.6</maven.compile.source> + <maven.compile.target>1.6</maven.compile.target> <disclaimer.dir>{project.basedir}</disclaimer.dir> </properties> @@ -54,8 +54,9 @@ </prerequisites> <profiles> + + <!-- Hudson profile --> <profile> - <!-- Hudson profile --> <id>CI</id> <build> <plugins> @@ -108,6 +109,8 @@ </plugins> </build> </profile> + + <!-- empire-db-dist --> <profile> <!-- Part of the release profile, merged with release profile defined in apache parent pom --> <id>apache-release</id> @@ -145,6 +148,15 @@ </plugins> </build> </profile> + + <!-- eclipse-plugin --> + <profile> + <id>eclipse-plugin</id> + <modules> + <module>empire-db-eclipse-codegen</module> + </modules> + </profile> + </profiles> @@ -574,6 +586,7 @@ <excludeDefaults>true</excludeDefaults> <outputDirectory>${project.build.directory}/site</outputDirectory> <plugins> + <!-- maven-project-info-reports-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> @@ -591,14 +604,17 @@ </reportSet> </reportSets> </plugin> + <!-- apache-rat-plugin --> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> </plugin> + <!-- maven-site-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> </plugin> + <!-- maven-pmd-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> @@ -607,6 +623,7 @@ <targetJdk>1.5</targetJdk> </configuration> </plugin> + <!-- findbugs-maven-plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> @@ -617,11 +634,13 @@ <omitVisitors>SerializableIdiom</omitVisitors> </configuration> </plugin> + <!-- jdepend-maven-plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jdepend-maven-plugin</artifactId> <version>2.0</version> </plugin> + <!-- cobertura-maven-plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> @@ -633,15 +652,18 @@ </formats> </configuration> </plugin> + <!-- maven-jxr-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.4</version> </plugin> + <!-- maven-javadoc-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> </plugin> + <!-- maven-changelog-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-changelog-plugin</artifactId>
