You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(11) |
Oct
(10) |
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(44) |
Feb
(30) |
Mar
(11) |
Apr
(43) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(9) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
(17) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <rfl...@us...> - 2008-04-26 16:38:41
|
Revision: 314 http://salto-db.svn.sourceforge.net/salto-db/?rev=314&view=rev Author: rflament Date: 2008-04-26 09:38:21 -0700 (Sat, 26 Apr 2008) Log Message: ----------- version 1.0.16 Added Paths: ----------- salto-db-generator/tags/v1_0_16/ salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java Removed Paths: ------------- salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java Copied: salto-db-generator/tags/v1_0_16 (from rev 312, salto-db-generator/trunk) Deleted: salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java 2007-12-20 15:33:07 UTC (rev 312) +++ salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java 2008-04-26 16:38:21 UTC (rev 314) @@ -1,37 +0,0 @@ -package com.salto.db.generator.plugin; - -import java.sql.DatabaseMetaData; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -/** - * @author remi - * - */ -public final class HibernateDialectHelper { - - private static final Map dialects = new HashMap(); - - static { - dialects.put("Oracle", "org.hibernate.dialect.OracleDialect"); - dialects.put("Microsoft SQL Server", "org.hibernate.dialect.SQLServerDialect"); - // TODO: fill this map - } - - public final String getHibernateDialect(DatabaseMetaData metaData) throws SQLException { - if (metaData == null) - return null; - - - if (metaData.getDatabaseProductName().equals("MySQL")) { - if (metaData.getDatabaseMajorVersion() >= 5) { - return "org.hibernate.dialect.MySQL5Dialect"; - } - return "org.hibernate.dialect.MySQLDialect"; - } else - return (String) dialects.get(metaData.getDatabaseProductName()); - - } - -} Copied: salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java (from rev 313, salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java) =================================================================== --- salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java (rev 0) +++ salto-db-generator/tags/v1_0_16/src/com/salto/db/generator/plugin/HibernateDialectHelper.java 2008-04-26 16:38:21 UTC (rev 314) @@ -0,0 +1,39 @@ +package com.salto.db.generator.plugin; + +import java.sql.DatabaseMetaData; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +/** + * @author remi + * + */ +public final class HibernateDialectHelper { + + private static final Map dialects = new HashMap(); + + static { + dialects.put("Oracle", "org.hibernate.dialect.OracleDialect"); + dialects.put("Microsoft SQL Server", "org.hibernate.dialect.SQLServerDialect"); + dialects.put("PostgreSQL", "org.hibernate.dialect.PostgreSQLDialect"); + dialects.put("HypersonicSQL", "org.hibernate.dialect.HSQLDialect"); + + } + + public final String getHibernateDialect(DatabaseMetaData metaData) throws SQLException { + if (metaData == null) + return null; + + + if (metaData.getDatabaseProductName().equals("MySQL")) { + if (metaData.getDatabaseMajorVersion() >= 5) { + return "org.hibernate.dialect.MySQL5Dialect"; + } + return "org.hibernate.dialect.MySQLDialect"; + } else + return (String) dialects.get(metaData.getDatabaseProductName()); + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2008-04-26 16:32:35
|
Revision: 313 http://salto-db.svn.sourceforge.net/salto-db/?rev=313&view=rev Author: rflament Date: 2008-04-26 09:32:20 -0700 (Sat, 26 Apr 2008) Log Message: ----------- new dialect Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java Modified: salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java 2007-12-20 15:33:07 UTC (rev 312) +++ salto-db-generator/trunk/src/com/salto/db/generator/plugin/HibernateDialectHelper.java 2008-04-26 16:32:20 UTC (rev 313) @@ -16,7 +16,9 @@ static { dialects.put("Oracle", "org.hibernate.dialect.OracleDialect"); dialects.put("Microsoft SQL Server", "org.hibernate.dialect.SQLServerDialect"); - // TODO: fill this map + dialects.put("PostgreSQL", "org.hibernate.dialect.PostgreSQLDialect"); + dialects.put("HypersonicSQL", "org.hibernate.dialect.HSQLDialect"); + } public final String getHibernateDialect(DatabaseMetaData metaData) throws SQLException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Marc H. <mar...@ho...> - 2008-01-15 10:17:11
|
=20 When I execute the following piece of code no record does appear in the tab= le. =20 Users users =3D new Users(); users.setUserid("mhuls"); users.setFirstname("Marc"); users.setLastname("Huls"); users.setPassword("winner"); System.out.println(users.getUserid() + " !"); dao.save(users); Users test =3D dao.getById(users.getUserid()); =20 I use HibernateDAO with pojos and GenericDAO. =20 Regards Marc Huls _________________________________________________________________ Nieuw: Windows Live Messenger 2008! Gratis downloaden http://get.live.com/messenger= |
From: <rfl...@us...> - 2007-12-20 15:33:16
|
Revision: 312 http://salto-db.svn.sourceforge.net/salto-db/?rev=312&view=rev Author: rflament Date: 2007-12-20 07:33:07 -0800 (Thu, 20 Dec 2007) Log Message: ----------- europa compatibility Modified Paths: -------------- salto-db-generator/trunk/.classpath Modified: salto-db-generator/trunk/.classpath =================================================================== --- salto-db-generator/trunk/.classpath 2007-09-19 15:42:45 UTC (rev 311) +++ salto-db-generator/trunk/.classpath 2007-12-20 15:33:07 UTC (rev 312) @@ -3,6 +3,6 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="lib" path="lib/velocity-dep-1.4.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/lib/ant.jar"/> + <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.apache.ant_1.7.0.v200706080842/lib/ant.jar"/> <classpathentry kind="output" path="bin"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Vince C. <vco...@ec...> - 2007-11-20 15:34:22
|
How do I add multiple tables to the ant task to generate. <!-- set a pattern to search for tables. You can use the joker character '%'. If you want to generate DataObjects for every tables, just set '%' --> <property name="tableName" value="annotation , annotation_tsearch"/> ? Vince |
From: <rfl...@us...> - 2007-09-19 15:42:47
|
Revision: 311 http://salto-db.svn.sourceforge.net/salto-db/?rev=311&view=rev Author: rflament Date: 2007-09-19 08:42:45 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/setter.vm Modified: salto-db-generator/trunk/templates/ejb3/setter.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 15:38:41 UTC (rev 310) +++ salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 15:42:45 UTC (rev 311) @@ -87,15 +87,7 @@ #set( $sprimarykeydone = "true" ) #end - /** - * @return ${col.javaAttName} - */ -#if ($annotations=="true") - @Transient -#end - public $col.getNonPrimitifClass() ${col.getterMethod()}() { - return this.${util.DoNameCreator.class2attribute($jdoInfo.javaClassName)}PK.${col.getterMethod()}(); - } + #set( $done = "true" ) #end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 15:38:42
|
Revision: 310 http://salto-db.svn.sourceforge.net/salto-db/?rev=310&view=rev Author: rflament Date: 2007-09-19 08:38:41 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm Modified: salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm 2007-09-19 15:34:26 UTC (rev 309) +++ salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm 2007-09-19 15:38:41 UTC (rev 310) @@ -9,6 +9,9 @@ #if ($pk == "Long") return Long.parseLong(request.getParameter("${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}Id")); #end +#if ($pk == "Short") + return Short.parseShort(request.getParameter("${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}Id")); +#end #if ($pk == "String") return text; #end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 15:34:36
|
Revision: 309 http://salto-db.svn.sourceforge.net/salto-db/?rev=309&view=rev Author: rflament Date: 2007-09-19 08:34:26 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/setter.vm Modified: salto-db-generator/trunk/templates/ejb3/setter.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 15:31:57 UTC (rev 308) +++ salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 15:34:26 UTC (rev 309) @@ -5,6 +5,15 @@ #foreach($colfk in ${jdoInfo.getImportedFk()}) #foreach($colfk2 in $colfk) #if($colfk2.getFkColumnName().equals($col.colName)) +#set( $bdone = "false" ) +#if ($util.getLength($jdoInfo.getPk()) > 1) +#foreach($colpk in ${jdoInfo.getPk()}) +#if ($colpk.col.equals($col.colName)) +#set( $bdone = "true" ) +#end +#end +#end +#if ($bdone=="false") #set ($done= "$fks.add($colfk2.fkName)" ) #if ($done == "true") /** @@ -52,6 +61,7 @@ #end #end #end +#end #if ($done=="false") #if ($util.getLength($jdoInfo.getPk()) > 1) #foreach($colpk in ${jdoInfo.getPk()}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 15:31:59
|
Revision: 308 http://salto-db.svn.sourceforge.net/salto-db/?rev=308&view=rev Author: rflament Date: 2007-09-19 08:31:57 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/variable.vm Modified: salto-db-generator/trunk/templates/ejb3/variable.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/variable.vm 2007-09-19 15:20:40 UTC (rev 307) +++ salto-db-generator/trunk/templates/ejb3/variable.vm 2007-09-19 15:31:57 UTC (rev 308) @@ -5,6 +5,15 @@ #foreach($colfk in ${jdoInfo.getImportedFk()}) #foreach($colfk2 in $colfk) #if($colfk2.getFkColumnName().equals($col.colName)) +#set( $bdone = "false" ) +#if ($util.getLength($jdoInfo.getPk()) > 1) +#foreach($colpk in ${jdoInfo.getPk()}) +#if ($colpk.col.equals($col.colName)) +#set( $bdone = "true" ) +#end +#end +#end +#if ($bdone=="false") #set ($done= "$fks.add($colfk2.fkName)" ) #if ($done=="true") /** @@ -18,6 +27,7 @@ #end #end #end +#end #if ($done=="false") #if ($util.getLength($jdoInfo.getPk()) > 1) #foreach($colpk in ${jdoInfo.getPk()}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 15:21:00
|
Revision: 307 http://salto-db.svn.sourceforge.net/salto-db/?rev=307&view=rev Author: rflament Date: 2007-09-19 08:20:40 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/dataobject.vm Modified: salto-db-generator/trunk/templates/ejb3/dataobject.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/dataobject.vm 2007-09-19 15:04:05 UTC (rev 306) +++ salto-db-generator/trunk/templates/ejb3/dataobject.vm 2007-09-19 15:20:40 UTC (rev 307) @@ -77,17 +77,62 @@ #foreach($col in ${jdoInfo.jdoColInfos}) #foreach($colpk in ${jdoInfo.getPk()}) #if ($colpk.col.equals($col.colName)) +#set( $aadone = "false" ) +#if ($util.getLength(${jdoInfo.getImportedFk()}) > 0) +#foreach($colfk in ${jdoInfo.getImportedFk()}) +#foreach($colfk2 in $colfk) +#if($colfk2.getFkColumnName().equals($col.colName)) /** + * Attribute ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))} + */ + private $util.DoNameCreator.createDoName($colfk2.getPkTableName()) ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))}; + +#set( $aadone = "true" ) +#end +#end +#end +#end +#if ($aadone=="false") + /** * Attribute ${col.javaAttName} */ private ${col.javaAttClass} $col.javaAttName; - #end + #end #end +#end #foreach($col in ${jdoInfo.jdoColInfos}) #foreach($colpk in ${jdoInfo.getPk()}) #if ($colpk.col.equals($col.colName)) +#set( $aadone = "false" ) +#if ($util.getLength(${jdoInfo.getImportedFk()}) > 0) +#foreach($colfk in ${jdoInfo.getImportedFk()}) +#foreach($colfk2 in $colfk) +#if($colfk2.getFkColumnName().equals($col.colName)) + /** + * get ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))} + */ +#if ($annotations=="true") + @ManyToOne + @JoinColumn(name = "$col.colName") +#end + public ${util.DoNameCreator.createDoName($colfk2.getPkTableName())} get${util.DoNameCreator.createDoName($colfk2.getPkTableName())}() { + return this.${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))}; + } + + /** + * set ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))} + */ + public void set${util.DoNameCreator.createDoName($colfk2.getPkTableName())}(${util.DoNameCreator.createDoName($colfk2.getPkTableName())} ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))}) { + this.${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))} = ${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))}; + } +#set( $aadone = "true" ) +#end +#end +#end +#end +#if ($aadone=="false") /** * Return ${col.javaAttName} */ @@ -104,10 +149,10 @@ public void ${col.setterMethod()}(${col.javaAttClass} ${col.javaAttName}) { this.${col.javaAttName} = ${col.javaAttName}; } - #end #end #end +#end /** * calculate hashcode This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 15:04:08
|
Revision: 306 http://salto-db.svn.sourceforge.net/salto-db/?rev=306&view=rev Author: rflament Date: 2007-09-19 08:04:05 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/setter.vm Modified: salto-db-generator/trunk/templates/ejb3/setter.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 09:28:47 UTC (rev 305) +++ salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 15:04:05 UTC (rev 306) @@ -29,7 +29,12 @@ #else @JoinColumn(name = "$col.colName") #end +#foreach($colpk in ${jdoInfo.getPk()}) +#if ($colpk.col.equals($col.colName)) + @Id #end +#end +#end public ${util.DoNameCreator.createDoName($colfk2.getPkTableName())} get${util.DoNameCreator.createDoName($colfk2.getPkTableName())}() { return this.${util.DoNameCreator.class2attribute($util.DoNameCreator.createDoName($colfk2.getPkTableName()))}; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 09:28:49
|
Revision: 305 http://salto-db.svn.sourceforge.net/salto-db/?rev=305&view=rev Author: rflament Date: 2007-09-19 02:28:47 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/ejb3/setter.vm Modified: salto-db-generator/trunk/templates/ejb3/setter.vm =================================================================== --- salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 09:28:28 UTC (rev 304) +++ salto-db-generator/trunk/templates/ejb3/setter.vm 2007-09-19 09:28:47 UTC (rev 305) @@ -89,6 +89,10 @@ #end #if ($done=="false") /** +#if (${col.colRemarks}) + * <p>${col.colRemarks} + * </p> +#end * @return ${col.javaAttName} */ #if ($annotations=="true") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-19 09:28:30
|
Revision: 304 http://salto-db.svn.sourceforge.net/salto-db/?rev=304&view=rev Author: rflament Date: 2007-09-19 02:28:28 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-09-06 13:08:42 UTC (rev 303) +++ salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-09-19 09:28:28 UTC (rev 304) @@ -19,7 +19,7 @@ #set ($pk="${jdoInfo.javaClassName}PK") #end /** - * <p>Hibernate DAO layer for ${jdoInfo.javaClassName}s</p> + * <p>Generic DAO layer for ${jdoInfo.javaClassName}s</p> * <p>Generated at $date</p> * * @author ${generatorVersion} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-09-06 13:08:44
|
Revision: 303 http://salto-db.svn.sourceforge.net/salto-db/?rev=303&view=rev Author: rflament Date: 2007-09-06 06:08:42 -0700 (Thu, 06 Sep 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/src/salto/tool/sql/DatabaseInfo.java Modified: salto-db-generator/trunk/src/salto/tool/sql/DatabaseInfo.java =================================================================== --- salto-db-generator/trunk/src/salto/tool/sql/DatabaseInfo.java 2007-08-18 16:15:44 UTC (rev 302) +++ salto-db-generator/trunk/src/salto/tool/sql/DatabaseInfo.java 2007-09-06 13:08:42 UTC (rev 303) @@ -241,7 +241,7 @@ ti.setNumPrecRadix(rs.getInt(10)); ti.setColNullable(rs.getInt(11)); try { - ti.setColRemarks(rs.getString(15)); + ti.setColRemarks(rs.getString(12)); } catch (Exception e) { } try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-08-18 16:15:48
|
Revision: 302 http://salto-db.svn.sourceforge.net/salto-db/?rev=302&view=rev Author: rflament Date: 2007-08-18 09:15:44 -0700 (Sat, 18 Aug 2007) Log Message: ----------- ignore object that are not tables or view (i.e indexes on postgresql) Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java Modified: salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java 2007-04-27 14:11:05 UTC (rev 301) +++ salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java 2007-08-18 16:15:44 UTC (rev 302) @@ -124,6 +124,9 @@ for (int j = 0; j < tableInfos.length; j++) { + if (!tableInfos[j].getTableType().equalsIgnoreCase("VIEW") && !tableInfos[j].getTableType().equalsIgnoreCase("TABLE")) { + continue; + } if (!genView && tableInfos[j].getTableType().equals("VIEW")) { log("Not applying plugin '" + tmpl + "' to " + tableInfos[j].getTableType() + " '" + tableInfos[j].getTableName() + "' because it's a view and generateView is set to false."); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From:
<ji...@is...> - 2007-04-30 14:20:05
|
[ http://issues.salto-consulting.com/jira/browse/SALTODB-16?page=3Dcomm= ents#action_10028 ]=20 =20 R=C3=A9mi Flament commented on SALTODB-16: ------------------------------------- SALTODB-9 > column length in Annotation > --------------------------- > > Key: SALTODB-16 > URL: http://issues.salto-consulting.com/jira/browse/SALTO= DB-16 > Project: Salto-db > Issue Type: Improvement > Components: Salto-db Generator > Reporter: Manuel Verriez > Assigned To: Manuel Verriez > Priority: Trivial > > Add field length attribute in Column annotation > ie: @Column(name=3D"first_name", length=3D50)=20 --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Manuel V. (JIRA) <ji...@is...> - 2007-04-30 14:20:04
|
[ http://issues.salto-consulting.com/jira/browse/SALTODB-16?page=all ] Manuel Verriez closed SALTODB-16. --------------------------------- Resolution: Fixed already done... > column length in Annotation > --------------------------- > > Key: SALTODB-16 > URL: http://issues.salto-consulting.com/jira/browse/SALTODB-16 > Project: Salto-db > Issue Type: Improvement > Components: Salto-db Generator > Reporter: Manuel Verriez > Assigned To: Manuel Verriez > Priority: Trivial > > Add field length attribute in Column annotation > ie: @Column(name="first_name", length=50) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Manuel V. (JIRA) <ji...@is...> - 2007-04-30 14:18:05
|
[ http://issues.salto-consulting.com/jira/browse/SALTODB-16?page=3Dall= ] Manuel Verriez reassigned SALTODB-16: ------------------------------------- Assignee: Manuel Verriez (was: R=C3=A9mi Flament) > column length in Annotation > --------------------------- > > Key: SALTODB-16 > URL: http://issues.salto-consulting.com/jira/browse/SALTO= DB-16 > Project: Salto-db > Issue Type: Improvement > Components: Salto-db Generator > Reporter: Manuel Verriez > Assigned To: Manuel Verriez > Priority: Trivial > > Add field length attribute in Column annotation > ie: @Column(name=3D"first_name", length=3D50)=20 --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Manuel V. (JIRA) <ji...@is...> - 2007-04-30 14:15:11
|
column length in Annotation --------------------------- Key: SALTODB-16 URL: http://issues.salto-consulting.com/jira/browse/SALTOD= B-16 Project: Salto-db Issue Type: Improvement Components: Salto-db Generator Reporter: Manuel Verriez Assigned To: R=C3=A9mi Flament Priority: Trivial Add field length attribute in Column annotation ie: @Column(name=3D"first_name", length=3D50)=20 --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <rfl...@us...> - 2007-04-27 14:11:08
|
Revision: 301 http://svn.sourceforge.net/salto-db/?rev=301&view=rev Author: rflament Date: 2007-04-27 07:11:05 -0700 (Fri, 27 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/src/salto/tool/jdo/data/JdoInfo.java Modified: salto-db-generator/trunk/src/salto/tool/jdo/data/JdoInfo.java =================================================================== --- salto-db-generator/trunk/src/salto/tool/jdo/data/JdoInfo.java 2007-04-27 14:10:55 UTC (rev 300) +++ salto-db-generator/trunk/src/salto/tool/jdo/data/JdoInfo.java 2007-04-27 14:11:05 UTC (rev 301) @@ -48,7 +48,7 @@ */ public String getJavaClassName() { if (javaClassName == null) - nameCreator.createDoName(tableName); + javaClassName = nameCreator.createDoName(tableName); return javaClassName; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-27 14:10:57
|
Revision: 300 http://svn.sourceforge.net/salto-db/?rev=300&view=rev Author: rflament Date: 2007-04-27 07:10:55 -0700 (Fri, 27 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/src/salto/tool/jdo/util/DoNameCreator.java Modified: salto-db-generator/trunk/src/salto/tool/jdo/util/DoNameCreator.java =================================================================== --- salto-db-generator/trunk/src/salto/tool/jdo/util/DoNameCreator.java 2007-04-27 14:10:28 UTC (rev 299) +++ salto-db-generator/trunk/src/salto/tool/jdo/util/DoNameCreator.java 2007-04-27 14:10:55 UTC (rev 300) @@ -1,10 +1,9 @@ package salto.tool.jdo.util; /** - * Interface permettant de cr�er les noms des attributs des composants - * Plusieurs algorithmes sont d�finies � partir des r�gles de nommage les - * plus courantes des bases de donn�es Date de cr�ation : (20/10/01 - * 05:17:16) + * Interface permettant de cr\xE9er les noms des attributs des composants Plusieurs + * algorithmes sont d\xE9finies \xE0 partir des r\xE8gles de nommage les plus courantes + * des bases de donn\xE9es Date de cr\xE9ation : (20/10/01 05:17:16) * * @author : E. Loiez */ @@ -93,6 +92,7 @@ * @return String */ public String createDoName(String tableName) { + return createDoName(tableName, prefix, defaultNameOffset); } @@ -130,7 +130,13 @@ } public String class2attribute(String className) { - return className.substring(0, 1).toLowerCase() + className.substring(1); + /* + * if (className == null) return null; + */ + if (className.length() > 1) { + return className.substring(0, 1).toLowerCase() + className.substring(1); + } else + return className.toLowerCase(); } public String attribute2class(String attributeName) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-27 14:10:38
|
Revision: 299 http://svn.sourceforge.net/salto-db/?rev=299&view=rev Author: rflament Date: 2007-04-27 07:10:28 -0700 (Fri, 27 Apr 2007) Log Message: ----------- follow foreign keys to add dependencies Modified Paths: -------------- salto-db-generator/trunk/src/salto/tool/sql/data/TableInfo.java Modified: salto-db-generator/trunk/src/salto/tool/sql/data/TableInfo.java =================================================================== --- salto-db-generator/trunk/src/salto/tool/sql/data/TableInfo.java 2007-04-27 14:09:56 UTC (rev 298) +++ salto-db-generator/trunk/src/salto/tool/sql/data/TableInfo.java 2007-04-27 14:10:28 UTC (rev 299) @@ -10,58 +10,72 @@ /** * Objet de donn�e repr�sentant la description d'une table + * * @author : el...@sa... */ public class TableInfo { /* - TABLE_CAT String => table catalog (may be null) - TABLE_SCHEM String => table schema (may be null) - TABLE_NAME String => table name - TABLE_TYPE String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". - REMARKS String => explanatory comment on the table - */ + * TABLE_CAT String => table catalog (may be null) TABLE_SCHEM String => + * table schema (may be null) TABLE_NAME String => table name TABLE_TYPE + * String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", + * "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". REMARKS String => + * explanatory comment on the table + */ /** * le catalogue */ protected String tableCat; + /** * le sch�ma */ protected String tableShem; + /** * nom de la table */ protected String tableName; + /** - * type de table. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". + * type de table. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL + * TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". */ protected String tableType; + /** * commentaire */ protected String tableRemarks; + /** * information de connection */ protected ConnectionInfo connInfo; + /** * description des colonnes */ protected TableColInfo[] colInfos; + /** * les colonnes de la cl� primaire */ protected TablePK[] pk = null; + /** - * les cl�s �trang�res + * les cl�s �trang�res */ protected TableFK[][] importedFk = null; + /** - * les cl�s �trang�res (la table est ma�tre) + * les cl�s �trang�res (la table est ma�tre) */ protected TableFK[][] exportedFk = null; + private Connection conn; + private ShemaInfo shemaInfo; + /** * @return Returns the shemaInfo. */ @@ -70,7 +84,8 @@ } /** - * @param shemaInfo The shemaInfo to set. + * @param shemaInfo + * The shemaInfo to set. */ public void setShemaInfo(ShemaInfo shemaInfo) { this.shemaInfo = shemaInfo; @@ -84,7 +99,8 @@ } /** - * @param conn The conn to set. + * @param conn + * The conn to set. */ public void setConn(Connection conn) { this.conn = conn; @@ -96,6 +112,7 @@ public TableInfo() { super(); } + public TableInfo(TableInfo tableInfo) { this(); tableCat = tableInfo.tableCat; @@ -108,7 +125,7 @@ pk = tableInfo.pk; importedFk = tableInfo.importedFk; exportedFk = tableInfo.exportedFk; - + } /** @@ -119,88 +136,115 @@ this.conn = shemaInfo.getConn(); this.connInfo = shemaInfo.getConnInfo(); } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * * @return java.lang.String */ public java.lang.String getTableCat() { return tableCat; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * * @return java.lang.String */ public java.lang.String getTableName() { return tableName; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * * @return java.lang.String */ public java.lang.String getTableRemarks() { return tableRemarks; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * * @return java.lang.String */ public java.lang.String getTableShem() { return tableShem; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * * @return java.lang.String */ public java.lang.String getTableType() { return tableType; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) - * @param newTableCat java.lang.String + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * + * @param newTableCat + * java.lang.String */ public void setTableCat(java.lang.String newTableCat) { tableCat = newTableCat; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) - * @param newTableName java.lang.String + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * + * @param newTableName + * java.lang.String */ public void setTableName(java.lang.String newTableName) { tableName = newTableName; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) - * @param newTableRemarks java.lang.String + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * + * @param newTableRemarks + * java.lang.String */ public void setTableRemarks(java.lang.String newTableRemarks) { tableRemarks = newTableRemarks; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) - * @param newTableShem java.lang.String + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * + * @param newTableShem + * java.lang.String */ public void setTableShem(java.lang.String newTableShem) { tableShem = newTableShem; } + /** - * Ins�rez la description de la m�thode � cet endroit. - * Date de cr�ation : (28/01/01 9:21:29) - * @param newTableType java.lang.String + * Ins�rez la description de la m�thode � cet endroit. Date de + * cr�ation : (28/01/01 9:21:29) + * + * @param newTableType + * java.lang.String */ public void setTableType(java.lang.String newTableType) { tableType = newTableType; } + /** * Gets the connInfo. + * * @return Returns a ConnectionInfo */ public ConnectionInfo getConnInfo() { @@ -209,7 +253,9 @@ /** * Sets the connInfo. - * @param connInfo The connInfo to set + * + * @param connInfo + * The connInfo to set */ public void setConnInfo(ConnectionInfo connInfo) { this.connInfo = connInfo; @@ -217,6 +263,7 @@ /** * Gets the primary key. + * * @return Returns a TablePK[] */ public TablePK[] getPk() { @@ -227,6 +274,7 @@ /** * Gets the imported foreign keys. + * * @return Returns a TableFK[][] */ public TableFK[][] getImportedFk() { @@ -237,6 +285,7 @@ /** * Gets the exported foreign keys. + * * @return Returns a TableFK[][] */ public TableFK[][] getExportedFk() { @@ -244,22 +293,27 @@ exportedFk = DatabaseInfo.getExportedFK(this); return exportedFk; } + public TableFK[][] getFK() { try { ArrayList list = new ArrayList(); Object[] obj = getImportedFk(); - if (obj != null) list.addAll(Arrays.asList(obj)); + if (obj != null) + list.addAll(Arrays.asList(obj)); obj = getExportedFk(); - if (obj != null) list.addAll(Arrays.asList(obj)); + if (obj != null) + list.addAll(Arrays.asList(obj)); return (TableFK[][]) list.toArray(new TableFK[list.size()][]); } catch (Exception e) { e.printStackTrace(); } return new TableFK[0][0]; } + public TableColInfo[] getColInfos() { return getColInfos(true); } + /** * @return */ @@ -276,8 +330,10 @@ public void setColInfos(TableColInfo[] infos) { colInfos = infos; } + /** - * retourne les colonnes qui sont autoincr�ment�s + * retourne les colonnes qui sont autoincr�ment�s + * * @return */ public List getAutoIncrementCols() { @@ -288,16 +344,24 @@ } } return list; - //return (TableColInfo[]) list.toArray(new TableColInfo[list.size()]); + // return (TableColInfo[]) list.toArray(new TableColInfo[list.size()]); } - + public int getColNum(String colName) { for (int i = 0; i < colInfos.length; i++) { if (colInfos[i].getColName().equals(colName)) { - return colInfos[i].getColPosition(); + return colInfos[i].getColPosition(); } } return -1; } + + public boolean equals(Object object) { + return this.tableName.equals(((TableInfo) object).tableName); + } + public int hashCode() { + return this.tableName.hashCode(); + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-27 14:10:10
|
Revision: 298 http://svn.sourceforge.net/salto-db/?rev=298&view=rev Author: rflament Date: 2007-04-27 07:09:56 -0700 (Fri, 27 Apr 2007) Log Message: ----------- follow foreign keys to add dependencies Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java salto-db-generator/trunk/src/com/salto/db/ant/RegisterPluginTask.java salto-db-generator/trunk/src/salto/tool/jdo/DataObjectCreate.java Modified: salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java 2007-04-24 18:57:30 UTC (rev 297) +++ salto-db-generator/trunk/src/com/salto/db/ant/DOGeneratorTask.java 2007-04-27 14:09:56 UTC (rev 298) @@ -4,19 +4,20 @@ import java.sql.DriverManager; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import salto.tool.jdo.DataObjectCreate; -import salto.tool.jdo.data.JdoColInfo; import salto.tool.jdo.data.JdoInfo; import salto.tool.sql.ConnectionInfo; import salto.tool.sql.DatabaseInfo; -import salto.tool.sql.data.TableColInfo; import salto.tool.sql.data.TableInfo; import com.salto.db.generator.plugin.IGeneratorPlugin; @@ -56,11 +57,15 @@ private String generateView = "true"; + private String followForeignKeys; + + private String maxDepth; + private static final String DEFAULT_PLUGIN = "Salto-db"; public void execute() throws BuildException { - log("Salto-DB ANT Generator - Salto Consulting"); + log("Salto-DB ANT Generator - Salto Consulting", Project.MSG_INFO); listPlugins(); Connection defaultConn = null; @@ -72,8 +77,7 @@ try { - ConnectionInfo connectionInfo = new ConnectionInfo(driverClassName, - jdbcUrl, login, password, schema); + ConnectionInfo connectionInfo = new ConnectionInfo(driverClassName, jdbcUrl, login, password, schema); Class.forName(driverClassName); defaultConn = DriverManager.getConnection(jdbcUrl, login, password); @@ -84,18 +88,15 @@ String tableNames[] = tablesNames.split(","); - ArrayList list = new ArrayList(); + Set set = new HashSet(); for (int k = 0; k < tableNames.length; k++) { - TableInfo[] tableInfos = DatabaseInfo.getTables(defaultConn, - null, schema, tableNames[k]); - log(tableInfos.length + " table(s) found for table name '" - + tableNames[k] + "'"); + TableInfo[] tableInfos = DatabaseInfo.getTables(defaultConn, null, schema, tableNames[k]); + log(tableInfos.length + " table(s) found for table name '" + tableNames[k] + "'"); - list.addAll(Arrays.asList(tableInfos)); + set.addAll(Arrays.asList(tableInfos)); } - TableInfo[] tableInfos = (TableInfo[]) list - .toArray(new TableInfo[list.size()]); + TableInfo[] tableInfos = (TableInfo[]) set.toArray(new TableInfo[set.size()]); IGeneratorPlugin p = Plugins.getInstance().getPlugin(plugin); if (p == null) { @@ -124,50 +125,34 @@ for (int j = 0; j < tableInfos.length; j++) { if (!genView && tableInfos[j].getTableType().equals("VIEW")) { - log("Not applying plugin '" - + tmpl - + "' to " - + tableInfos[j].getTableType() - + " '" - + tableInfos[j].getTableName() - + "' because it's a view and generateView is set to false."); + log("Not applying plugin '" + tmpl + "' to " + tableInfos[j].getTableType() + " '" + tableInfos[j].getTableName() + "' because it's a view and generateView is set to false."); } else { try { - log("Applying plugin '" + tmpl + "' to " - + tableInfos[j].getTableType() + " '" - + tableInfos[j].getTableName() + "'"); + log("Applying plugin '" + tmpl + "' to " + tableInfos[j].getTableType() + " '" + tableInfos[j].getTableName() + "'"); tableInfos[j].setConnInfo(connectionInfo); - TableColInfo[] colInfos = DatabaseInfo - .getColumns(tableInfos[j]); - if (colInfos != null) { - tableInfos[j].setColInfos(colInfos); - JdoInfo jdoInfo = new JdoInfo(tableInfos[j]); - JdoColInfo[] infos = new JdoColInfo[colInfos.length]; - for (int i = 0; i < colInfos.length; i++) { - infos[i] = new JdoColInfo(colInfos[i]); - } - jdoInfos.add(jdoInfo); - } else { - log("Skipping " - + tableInfos[j].getTableType() - + " '" - + tableInfos[j].getTableName() - + "' because it was not possible to read it."); - } + JdoInfo jdoInfo = DataObjectCreate.createJdoInfoFromTableInfo(tableInfos[j]); + jdoInfos.add(jdoInfo); } catch (Exception e) { - log("Skipping " + tableInfos[j].getTableType() + " '" - + tableInfos[j].getTableName() - + "' because it throws an error " + e); + log("Skipping " + tableInfos[j].getTableType() + " '" + tableInfos[j].getTableName() + "' because it throws an error " + e); } } } if (jdoInfos.size() > 0) { - new DataObjectCreate().creerDoSimple(prefix, - nameOffsetInt, this.getProject().getBaseDir() + "/" - + outputDir, packageName, (JdoInfo[]) jdoInfos - .toArray(new JdoInfo[jdoInfos.size()]), tmpl); + Integer maxDepthf = null; + if (followForeignKeys != null && Boolean.valueOf(followForeignKeys).booleanValue()) { + log("followForeignKeys enabled"); + if (maxDepth != null) { + maxDepthf = Integer.valueOf(this.maxDepth); + log("maxDepth = " + maxDepthf); + } + + } else { + maxDepthf = new Integer(0); + } + + new DataObjectCreate().creerDoSimple(prefix, nameOffsetInt, this.getProject().getBaseDir() + "/" + outputDir, packageName, (JdoInfo[]) jdoInfos.toArray(new JdoInfo[jdoInfos.size()]), tmpl, maxDepthf); } } catch (Exception e) { @@ -190,8 +175,7 @@ public void listPlugins() { log("-----------------------------------------"); log("Loaded Plugins : "); - for (Iterator i = Plugins.getInstance().getPlugins().entrySet() - .iterator(); i.hasNext();) { + for (Iterator i = Plugins.getInstance().getPlugins().entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); log((String) entry.getKey()); } @@ -294,4 +278,20 @@ this.generateView = generateView; } + public String getFollowForeignKeys() { + return followForeignKeys; + } + + public void setFollowForeignKeys(String followForeignKeys) { + this.followForeignKeys = followForeignKeys; + } + + public String getMaxDepth() { + return maxDepth; + } + + public void setMaxDepth(String maxDepth) { + this.maxDepth = maxDepth; + } + } Modified: salto-db-generator/trunk/src/com/salto/db/ant/RegisterPluginTask.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/ant/RegisterPluginTask.java 2007-04-24 18:57:30 UTC (rev 297) +++ salto-db-generator/trunk/src/com/salto/db/ant/RegisterPluginTask.java 2007-04-27 14:09:56 UTC (rev 298) @@ -1,6 +1,7 @@ package com.salto.db.ant; import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import com.salto.db.generator.plugin.IGeneratorPlugin; @@ -25,8 +26,8 @@ } public void execute() throws BuildException { - log("registering plugin from classname '" + className + "'"); - + log("Registering plugin from classname '" + className + "'"); + try { Class c = Class.forName(className); IGeneratorPlugin plugin = (IGeneratorPlugin) c.newInstance(); Modified: salto-db-generator/trunk/src/salto/tool/jdo/DataObjectCreate.java =================================================================== --- salto-db-generator/trunk/src/salto/tool/jdo/DataObjectCreate.java 2007-04-24 18:57:30 UTC (rev 297) +++ salto-db-generator/trunk/src/salto/tool/jdo/DataObjectCreate.java 2007-04-27 14:09:56 UTC (rev 298) @@ -2,9 +2,21 @@ package salto.tool.jdo; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + import salto.tool.ide.IdeException; +import salto.tool.jdo.data.JdoColInfo; import salto.tool.jdo.data.JdoInfo; import salto.tool.jdo.util.CreatorUtil; +import salto.tool.sql.DatabaseInfo; +import salto.tool.sql.data.TableColInfo; +import salto.tool.sql.data.TableFK; +import salto.tool.sql.data.TableInfo; import com.salto.db.generator.plugin.IGeneratorPlugin; import com.salto.db.generator.plugin.Plugins; @@ -140,6 +152,75 @@ } /** + * TODO : this code is ugly + * + * @param jdoInfos + * @return + */ + private JdoInfo[] extend(JdoInfo[] jdoInfos) { + Set tablesNames = new HashSet(); + Set addedTablesNames = new HashSet(); + + try { + List jdo = new ArrayList(); + + for (int j = 0; j < jdoInfos.length; j++) { + tablesNames.add(jdoInfos[j].getTableName()); + } + + for (int j = 0; j < jdoInfos.length; j++) { + + TableFK[][] fks = jdoInfos[j].getFK(); + for (int i = 0; i < fks.length; i++) { + for (int k = 0; k < fks[i].length; k++) { + + String newTableName = fks[i][k].getPkTableName(); + + if (fks[i][k].getPkTableName().equals(jdoInfos[j].getTableName())) { + newTableName = fks[i][k].getFkTableName(); + } + + boolean already = tablesNames.contains(newTableName); + if (!already) { + addedTablesNames.add(newTableName); + System.out.println("Adding table " + newTableName + " as it is needed by table " + jdoInfos[j].getTableName()); + + } + } + + } + + } + + ArrayList list = new ArrayList(); + for (Iterator iterator = addedTablesNames.iterator(); iterator.hasNext();) { + String string = (String) iterator.next(); + TableInfo[] tableInfos = DatabaseInfo.getTables(jdoInfos[0].getConnInfo().getConn(), null, jdoInfos[0].getTableShem(), string); + list.addAll(Arrays.asList(tableInfos)); + } + + TableInfo[] tableInfos = (TableInfo[]) list.toArray(new TableInfo[list.size()]); + + for (int f = 0; f < tableInfos.length; f++) { + tableInfos[f].setConnInfo(jdoInfos[0].getConnInfo()); + JdoInfo jdoInfo = DataObjectCreate.createJdoInfoFromTableInfo(tableInfos[f]); + jdo.add(jdoInfo); + } + + if (!jdo.isEmpty()) { + jdo.addAll(Arrays.asList(jdoInfos)); + jdoInfos = (JdoInfo[]) jdo.toArray(new JdoInfo[jdo.size()]); + } + + } catch (Exception e) { + + e.printStackTrace(); + } + return jdoInfos; + + } + + /** * Méthode permettant de générer les dataobjects Date de création : * (7/02/01 17:55:57) * @@ -151,22 +232,27 @@ * @return void * @exception JdoCreateException,IdeException */ - public void creerDoSimple(String doPrefix, - int defaultNameOffset, String srcPath, String pckName, - JdoInfo[] jdoInfos, String pluginName) throws JdoCreateException, - IdeException { + public void creerDoSimple(String doPrefix, int defaultNameOffset, String srcPath, String pckName, JdoInfo[] jdoInfos, String pluginName, Integer maxExtendIteration) throws JdoCreateException, IdeException { + int size = jdoInfos.length; + int previousSize = 0; + int i = 0; + + while (size > previousSize && ((maxExtendIteration != null && i < maxExtendIteration.intValue()) || maxExtendIteration == null)) { + jdoInfos = extend(jdoInfos); + previousSize = size; + size = jdoInfos.length; + i++; + } + IGeneratorPlugin plugin = null; try { plugin = Plugins.getInstance().getPlugin(pluginName); if (plugin != null) { - plugin.init(doPrefix, defaultNameOffset, srcPath, - pckName); + plugin.init(doPrefix, defaultNameOffset, srcPath, pckName); for (int j = 0; j < jdoInfos.length; j++) { - String doName = CreatorUtil.getDoNameCreator() - .createDoName(jdoInfos[j].getTableName(), doPrefix, - defaultNameOffset); + String doName = CreatorUtil.getDoNameCreator().createDoName(jdoInfos[j].getTableName(), doPrefix, defaultNameOffset); plugin.execute(doName, jdoInfos[j]); } @@ -187,4 +273,23 @@ } + public static JdoInfo createJdoInfoFromTableInfo(TableInfo tableInfo) { + + TableColInfo[] colInfos = DatabaseInfo.getColumns(tableInfo); + if (colInfos != null) { + tableInfo.setColInfos(colInfos); + JdoInfo jdoInfo = new JdoInfo(tableInfo); + JdoColInfo[] infos = new JdoColInfo[colInfos.length]; + for (int i = 0; i < colInfos.length; i++) { + infos[i] = new JdoColInfo(colInfos[i]); + } + + return jdoInfo; + } else { + System.out.println("Skipping " + tableInfo.getTableType() + " '" + tableInfo.getTableName() + "' because it was not possible to read it."); + return null; + } + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-24 18:57:31
|
Revision: 297 http://svn.sourceforge.net/salto-db/?rev=297&view=rev Author: rflament Date: 2007-04-24 11:57:30 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/springwebapp/editor.vm salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm Modified: salto-db-generator/trunk/templates/springwebapp/editor.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/editor.vm 2007-04-24 18:57:18 UTC (rev 296) +++ salto-db-generator/trunk/templates/springwebapp/editor.vm 2007-04-24 18:57:30 UTC (rev 297) @@ -43,7 +43,10 @@ #if ($pk == "Long") return Long.parseLong(text); #end +#if ($pk == "String") + return text; #end +#end } public void setAsText(String text) throws IllegalArgumentException { Modified: salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm 2007-04-24 18:57:18 UTC (rev 296) +++ salto-db-generator/trunk/templates/springwebapp/getpkfromrequest.vm 2007-04-24 18:57:30 UTC (rev 297) @@ -9,5 +9,8 @@ #if ($pk == "Long") return Long.parseLong(request.getParameter("${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}Id")); #end +#if ($pk == "String") + return text; #end +#end } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-24 18:57:19
|
Revision: 296 http://svn.sourceforge.net/salto-db/?rev=296&view=rev Author: rflament Date: 2007-04-24 11:57:18 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm Modified: salto-db-generator/trunk/templates/springwebapp/pom.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-24 18:56:54 UTC (rev 295) +++ salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-24 18:57:18 UTC (rev 296) @@ -197,12 +197,6 @@ <scope>compile</scope> </dependency> <dependency> - <groupId>org.tuckey</groupId> - <artifactId>urlrewrite</artifactId> - <version>3.0-beta</version> - <scope>compile</scope> - </dependency> - <dependency> <groupId>commons-attributes</groupId> <artifactId>commons-attributes-api</artifactId> <version>2.1</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |