[jira] Commented: (TORQUE-79) TorqueInstance.getConnection should throw an interpretable error message if Torque is not initialized
[ https://issues.apache.org/jira/browse/TORQUE-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467274 ] Thomas Vandahl commented on TORQUE-79: -- As far as I can tell, all access to the TorqueInstance goes thru Torque.getInstance(), doesn't it? Wouldn't it be better to place the check there? Maybe one could start initialization automatically, there are places inside Torque where something similar is already done. What do you think? > TorqueInstance.getConnection should throw an interpretable error message if > Torque is not initialized > - > > Key: TORQUE-79 > URL: https://issues.apache.org/jira/browse/TORQUE-79 > Project: Torque > Issue Type: Improvement > Components: Runtime >Affects Versions: 3.3-RC1 >Reporter: Thomas Fischer > Assigned To: Thomas Fischer >Priority: Trivial > Fix For: 4.0 > > > From the users mailing list, if Torque.getConection() is called and Torque is > not initiialized, the error message is now > java.lang.NullPointerException: There was no DataSourceFactory configured for > the connection XXX > at > org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:711) > at org.apache.torque.Torque.getConnection(Torque.java:268) > at > org.apache.torque.util.Transaction.beginOptional(Transaction.java:80) > at org.apache.torque.util.Transaction.begin(Transaction.java:62) > . > There should be a check whether Torque is initialized, and an exception > thrown which says that Torque is not initialized if it is not. > This issue does not block the release of Torque-3.3-RC2 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r499556 - in /db/torque: generator/trunk/src/conf/ generator/trunk/xdocs/ maven-plugin/trunk/ maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/ maven2-plugin/trunk/src/test/java/or
Author: tfischer Date: Wed Jan 24 12:23:57 2007 New Revision: 499556 URL: http://svn.apache.org/viewvc?view=rev&rev=499556 Log: The base classes and the non-base-classes can now be generated into two different directories. In the maven 2 plugin, the default behaviour is to generate the base classes into a subdirectory of target and the non-base classes in a subdirectory of src. In maven 1 and ant, the default is to use the same directory for both the base and non-base classes. Added: db/torque/templates/trunk/src/templates/om/ControlBase.vm Modified: db/torque/generator/trunk/src/conf/build-torque.xml db/torque/generator/trunk/src/conf/default.properties db/torque/generator/trunk/xdocs/properties-reference.xml db/torque/maven-plugin/trunk/plugin.jelly db/torque/maven-plugin/trunk/plugin.properties db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/TexenTaskMojo.java db/torque/maven2-plugin/trunk/src/test/java/org/apache/torque/mojo/TorqueOMMojoTest.java db/torque/site/trunk/xdocs/changes.xml db/torque/templates/trunk/src/templates/om/Control.vm db/torque/test/trunk/test-project/maven.xml db/torque/test/trunk/test-project/project.properties Modified: db/torque/generator/trunk/src/conf/build-torque.xml URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/conf/build-torque.xml?view=diff&rev=499556&r1=499555&r2=499556 == --- db/torque/generator/trunk/src/conf/build-torque.xml (original) +++ db/torque/generator/trunk/src/conf/build-torque.xml Wed Jan 24 12:23:57 2007 @@ -551,6 +551,19 @@ excludes="${torque.schema.om.excludes}" /> + + + @@ -559,6 +572,19 @@ controlTemplate="${torque.template.om}" outputDirectory="${torque.java.dir}" outputFile="report.${torque.project}.om.generation" + targetDatabase="${torque.database}" + targetPackage="${torque.targetPackage}" + templatePath="${torque.templatePath}"> + + + Modified: db/torque/generator/trunk/src/conf/default.properties URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/conf/default.properties?view=diff&rev=499556&r1=499555&r2=499556 == --- db/torque/generator/trunk/src/conf/default.properties (original) +++ db/torque/generator/trunk/src/conf/default.properties Wed Jan 24 12:23:57 2007 @@ -58,6 +58,7 @@ torque.doc.dir = ${torque.output.dir}/doc torque.java.dir = ${torque.output.dir}/java +torque.java.base.dir = ${torque.java.dir} torque.javadoc.dir = ${torque.output.dir}/javadoc torque.ojb.dir = ${torque.output.dir}/ojb torque.sql.dir = ${torque.output.dir}/sql @@ -143,6 +144,7 @@ torque.template.sql = sql/base/Control.vm torque.template.om = om/Control.vm +torque.template.om.base = om/ControlBase.vm torque.template.idTable = sql/id-table/Control.vm torque.template.dataDtd = data/Control.vm torque.template.dataDump = data/dump/Control.vm Modified: db/torque/generator/trunk/xdocs/properties-reference.xml URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/xdocs/properties-reference.xml?view=diff&rev=499556&r1=499555&r2=499556 == --- db/torque/generator/trunk/xdocs/properties-reference.xml (original) +++ db/torque/generator/trunk/xdocs/properties-reference.xml Wed Jan 24 12:23:57 2007 @@ -182,7 +182,12 @@ torque.java.dir ${maven.src.dir}/java - The directory to place all of the generated Java code in. + The directory to place the generated non-base Java code in. + + + torque.java.base.dir + ${torque.java.dir}/java + The directory to place the generated base Java code in. torque.sql.dir Modified: db/torque/maven-plugin/trunk/plugin.jelly URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/plugin.jelly?view=diff&rev=499556&r1=499555&r2=499556 == --- db/torque/maven-plugin/trunk/plugin.jelly (original) +++ db/torque/maven-plugin/trunk/plugin.jelly Wed Jan 24 12:23:57 2007 @@ -280,6 +280,7 @@ +Generating Non-Base Classes +Generating Base Classes + + + +Generating Non-Base Classes + + +Generating Base Classes + Modified: db/torque/maven-plugin/trunk/plugin.properties URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/plugin.properties?view=diff&rev=499556&r1=499555&r2=499556 == --- db/torque/maven-plugin/trunk/plugin.properties (original) +++ db/torque/mav
[jira] Commented: (TORQUE-72) Beans should not require torque.objectIsCaching = true setting to create all complexModel methods.
[ https://issues.apache.org/jira/browse/TORQUE-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467135 ] Thomas Fischer commented on TORQUE-72: -- Never mind the response time. My response time is far worse some times:-( but then we're volunteers and not paid for this, so no need to scrape the last bit off the free time in my opinion. Ok, so I'd suggest the following: If complexObjectModel = true, there should be a getter, a setter and a list of objects in the bean. If objectIsCaching=false, this setter in the bean will not be used in data object-> bean conversion, and the getter in the bean will not be used in bean->data object conversion. So the user can fill the related objects in the bean manually, but they are not filled automatically. If objectIsCaching=true, the current behaviour is retained. This is the best solution I can think of with the foreign keys getters and setters in the bean for objectIsCaching=false. > Beans should not require torque.objectIsCaching = true setting to create all > complexModel methods. > -- > > Key: TORQUE-72 > URL: https://issues.apache.org/jira/browse/TORQUE-72 > Project: Torque > Issue Type: Bug > Components: Generator >Affects Versions: 3.3 >Reporter: CG Monroe >Priority: Minor > > Record Objects generated with complexModel = true will include the get all > associated FK records methods, e.g. > List books = author.getBooks() > regardless of the objectIsCaching setting. > Beans however, will NOT generate the get associated FK records methods unless > objectIsCaching is true. > FWIW, the get related PK object methods are generated, e.g. > Author a = book.getAuthor(); > regardless of objectIsCaching. > The Bean template coding needs to be reviewed and fixed to generate code > correctly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (TORQUE-79) TorqueInstance.getConnection should throw an interpretable error message if Torque is not initialized
TorqueInstance.getConnection should throw an interpretable error message if Torque is not initialized - Key: TORQUE-79 URL: https://issues.apache.org/jira/browse/TORQUE-79 Project: Torque Issue Type: Improvement Components: Runtime Affects Versions: 3.3-RC1 Reporter: Thomas Fischer Assigned To: Thomas Fischer Priority: Trivial Fix For: 4.0 >From the users mailing list, if Torque.getConection() is called and Torque is >not initiialized, the error message is now java.lang.NullPointerException: There was no DataSourceFactory configured for the connection XXX at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:711) at org.apache.torque.Torque.getConnection(Torque.java:268) at org.apache.torque.util.Transaction.beginOptional(Transaction.java:80) at org.apache.torque.util.Transaction.begin(Transaction.java:62) . There should be a check whether Torque is initialized, and an exception thrown which says that Torque is not initialized if it is not. This issue does not block the release of Torque-3.3-RC2 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]