Code Generator for Eclipse Code
Brought to you by:
hotzst
--- a/trunk/ch.sahits.model/src/ch/sahits/model/internal/java/GeneratedJavaDBClassBuilder.java +++ b/trunk/ch.sahits.model/src/ch/sahits/model/internal/java/GeneratedJavaDBClassBuilder.java @@ -13,6 +13,8 @@ * Name of the database product */ String dbProductName=null; + /** Flag indicating the pseudo database use */ + private boolean pseudoDB=false; /** * Set the database product name * @param dbProductName @@ -38,7 +40,7 @@ @Override protected void validate() { super.validate(); - if (dbProductName==null) throw new NullPointerException("The database product may not be null"); + if (dbProductName==null && !pseudoDB) throw new NullPointerException("The database product may not be null"); } /** * Initialize the builder with a model @@ -50,6 +52,14 @@ this.dbProductName(model.getDbProductName()); return this; } - + /** + * Set a flag that indicates, that the structures of a database is used but not + * its fully internal representation. This takes effect ven validating the builder + * before the build method is completed + * @param isPseudoDatabase + */ + public void setPseudeDatabase(boolean isPseudoDatabase){ + this.pseudoDB=isPseudoDatabase; + } }
--- a/trunk/ch.sahits.model/src/ch/sahits/model/internal/java/JavaDataBaseTableBuilder.java +++ b/trunk/ch.sahits.model/src/ch/sahits/model/internal/java/JavaDataBaseTableBuilder.java @@ -7,8 +7,6 @@ import ch.sahits.model.db.IBasicDataBaseTable; import ch.sahits.model.db.IDatabaseTableField; import ch.sahits.model.db.IDatabaseTableIndex; -import ch.sahits.model.java.IGeneratedJavaDBClass2; -import ch.sahits.model.java.IGeneratedJavaDBClassBuilder; import ch.sahits.model.java.db.IJavaDataBaseTableBuilder; import ch.sahits.model.java.db.IJavaDatabaseTable; /** @@ -53,6 +51,8 @@ * List of all indexes for this table */ public List<IDatabaseTableIndex> indexes=new ArrayList<IDatabaseTableIndex>(); + /** Flag indicating the pseudo database use */ + private boolean pseudoDB=false; /** * Set the database name * @param dbName @@ -153,7 +153,7 @@ // if (host==null) throw new NullPointerException("The host may not be null"); // if (password==null) throw new NullPointerException("The password may not be null"); // if (port==null) throw new NullPointerException("The port may not be null"); - if (tableName==null) throw new NullPointerException("The table name may not be null"); //$NON-NLS-1$ + if (tableName==null && !pseudoDB) throw new NullPointerException("The table name may not be null"); //$NON-NLS-1$ // if (userName==null) throw new NullPointerException("The user name may not be null"); } /** @@ -225,6 +225,16 @@ } return null; } - + /** + * Set a flag that indicates, that the structures of a database is used but not + * its fully internal representation. This takes effect ven validating the builder + * before the build method is completed + * @param isPseudoDatabase + */ + @Override + public void setPseudeDatabase(boolean isPseudoDatabase){ + super.setPseudeDatabase(isPseudoDatabase); + this.pseudoDB=isPseudoDatabase; + } }
--- a/trunk/ch.sahits.model/src/ch/sahits/model/java/IGeneratedJavaDBClassBuilder.java +++ b/trunk/ch.sahits.model/src/ch/sahits/model/java/IGeneratedJavaDBClassBuilder.java @@ -19,5 +19,12 @@ * @return this */ public IGeneratedJavaDBClassBuilder databaseTable(IGeneratedJavaDBClass2 model); + /** + * Set a flag that indicates, that the structures of a database is used but not + * its fully internal representation. This takes effect ven validating the builder + * before the build method is completed + * @param isPseudoDatabase + */ + public void setPseudeDatabase(boolean isPseudoDatabase); } \ No newline at end of file