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] [Commented] (TORQUE-317) BaseBean does generate fields for referencing objects
Date Wed, 20 Aug 2014 18:38:26 GMT

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

Rob Decker commented on TORQUE-317:
-----------------------------------

I tried the torque-test and it worked. The .vm files are the same so I tried not setting torque.om.objectIsCaching
and torque.om.complexObjectModel explicity since they both default to true in option.properties
anyway. This worked. I am using the TorqueGeneratorTask in ant and setting the values using
<option key="" value=""/> elements. 

I tried commenting out torque.om.useIsForBooleanGetters and it stopped using "is" for boolean
getters. I put it back in and it uses "is" for boolean getters. So that one is getting passed
through correctly when its true but it is not using the default option (which is true) when
I don't pass it in at all.
 
It is definitely picking up things like torque.om.package suffixes.

Here's snippet from my ant build.xml:
{noformat}
<?xml version="1.0"?>
<project name="Torque" default="main" basedir=".">
  <property file="build.properties"/>
<taskdef
    name="torque-generator"
    classpathref="ant-classpath"
    classname="org.apache.torque.ant.task.TorqueGeneratorTask"/>

<torque-generator 
        packaging="classpath"
        configPackage="org.apache.torque.templates.om"
        sourceDir="${torque.schema.source.dir}"
      	defaultOutputDir="${torque.target.generated.sources.dir}">
      <option key="torque.database" value="${torque.database}"/>
      <option key="torque.om.addGetByNameMethods" value="${torque.om.addGetByNameMethods}"/>
      <option key="torque.om.addSaveMethods" value="${torque.om.addSaveMethods}"/>
...
<!-- option key="torque.om.complexObjectModel" value="${torque.om.complexObjectModel}"/
-->
      <!-- option key="torque.om.objectIsCaching" value="${torque.om.objectIsCaching}"/
-->
      <option key="torque.om.silentDbFetch" value="${torque.om.silentDbFetch}"/>
      <option key="torque.om.useIsForBooleanGetters" value="${torque.om.useIsForBooleanGetters}"/>
{noformat}

Here's a snippet from my build.properites:
{noformat}
torque.om.package.dbObjectPackageSuffix=.dbobject
torque.om.package.baseDbObjectPackageSuffix=.dbobject.base
torque.om.package.peerPackageSuffix=.peer
torque.om.package.basePeerPackageSuffix=.peer.base
torque.om.useManagers=false
torque.om.complexObjectModel=true  
torque.om.objectIsCaching=true
torque.om.silentDbFetch=true
{noformat}


> 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