db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Decker (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (TORQUE-317) BaseBean does generate fields for referencing objects
Date Tue, 19 Aug 2014 21:21:19 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14102862#comment-14102862
] 

Rob Decker edited comment on TORQUE-317 at 8/19/14 9:19 PM:
------------------------------------------------------------

I have torque.om.complexObjectModel=true. 

I did "fix" the problem after reading the updates. Thanks for the hint Thomas. 

It seems #if ($torqueGen.option("torque.om.complexObjectModel")) was actually what working
for adding the methods and #if ($torqueGen.booleanOption("torque.om.complexObjectModel"))
was preventing the field references from getting added. 

I tried adding #if ($complexObjectModel == "true") but it didn't work. Maybe there is some
underlying problem with setting complexObjectModel. I double checked that I am setting it
correctly before the generation. 

Here's the patch that made it work for me:
{noformat}

--- torque-templates-4.0-orig/org/apache/torque/templates/om/templates/bean/base/baseBean.vm
   2014-05-14 16:57:24.186114541 -0400
+++ torque-templates-4.0-new/org/apache/torque/templates/om/templates/bean/base/baseBean.vm
    2014-08-19 16:52:48.000000000 -0400
@@ -78,7 +78,7 @@
 $torqueGen.mergepoint("fieldDefinitions")
 ##
 ## field definitions for referenced objects
-#if ($torqueGen.booleanOption("torque.om.complexObjectModel"))
+#if ($torqueGen.option("torque.om.complexObjectModel"))
 $torqueGen.mergepoint("fieldDefinitionsReferencedObjects")
 ##
 ## field definitions for referencing objects
{noformat}



was (Author: rdecker):
I have torque.om.complexObjectModel=true. 

I did "fix" the problem after reading the updates. Thanks for the hint Thomas. 

It seems #if ($torqueGen.option("torque.om.complexObjectModel")) was actually what working
for adding the methods and #if ($torqueGen.booleanOption("torque.om.complexObjectModel"))
was preventing the field references from getting added. 

I tried adding #if ($complexObjectModel == "true") but it didn't work. Maybe there is some
underlying problem with setting complexObjectModel. I double checked that I am setting it
correctly before the generation. 

Here's the patch that made it work for me:

--- torque-templates-4.0-orig/org/apache/torque/templates/om/templates/bean/base/baseBean.vm
   2014-05-14 16:57:24.186114541 -0400
+++ torque-templates-4.0-new/org/apache/torque/templates/om/templates/bean/base/baseBean.vm
    2014-08-19 16:52:48.000000000 -0400
@@ -78,7 +78,7 @@
 $torqueGen.mergepoint("fieldDefinitions")
 ##
 ## field definitions for referenced objects
-#if ($torqueGen.booleanOption("torque.om.complexObjectModel"))
+#if ($torqueGen.option("torque.om.complexObjectModel"))
 $torqueGen.mergepoint("fieldDefinitionsReferencedObjects")
 ##
 ## field definitions for referencing objects


> BaseBean does generate fields for referencing objects
> -----------------------------------------------------
>
>                 Key: TORQUE-317
>                 URL: https://issues.apache.org/jira/browse/TORQUE-317
>             Project: Torque
>          Issue Type: Bug
>          Components: Templates
>    Affects Versions: 4.0
>         Environment: Centos 6.4, Java 8
>            Reporter: Rob Decker
>            Assignee: Thomas Fox
>            Priority: Critical
>
> In the baseBean.vm template the field definitions for referenced objects mergepoints
are present but the generated beans do not contain the fields. The methods do properly reference
the fields but the code does not compile because the field declarations are missing. 
> ## field definitions for referenced objects
> #if ($torqueGen.booleanOption("torque.om.complexObjectModel"))
> $torqueGen.mergepoint("fieldDefinitionsReferencedObjects")
> ##
> ## field definitions for referencing objects
> $torqueGen.mergepoint("fieldDefinitionsReferencingObjects")
> #end
> I am not familiar enough with templates to figure why it isn't working.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message