cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Eclipse/Modeler/Magic
Date Fri, 08 Aug 2014 06:55:06 GMT
Works semi-automatically for me. I put a declaration for “cgen” in my Maven pom. After
a model change I do refresh in Eclipse, and this triggers Maven invocation. Then I have to
do refresh again, so I can see the changes. Having said that I am +1 on CAY-1723.

Andrus

On Aug 7, 2014, at 9:49 PM, John Huss <johnthuss@gmail.com> wrote:

> On Thu, Aug 7, 2014 at 12:35 PM, Lon Varscsak <lon.varscsak@gmail.com>
> wrote:
> 
>> Hey guys,
>> 
>> A couple fo questions about class generation:
>> 
>> 1) Is it possible to trigger (from within Eclipse) an automated build of
>> the classes when the model file changes?  I had this with WebObjects/WOLips
>> and it's such nice feature.
>> 
> 
> No   :-(
> 
> But I haven't found it to be much of an issue.  It's pretty easy to
> generate the classes from the Modeler menu, or from an ant target.  I do it
> both ways, but use ant more often now since it always has the right
> settings.
> 
> If you are using ant, the setup could look like this:
> 
> <path id="cgen.classpath">
> <fileset dir="path/to/cayenne" includes="cayenne-server*.jar" />
> <fileset dir="path/to/cayenne" includes="cayenne-di*.jar" />
> <fileset dir="path/to/cayenne" includes="commons-*.jar" />
> <fileset dir="path/to/cayenne" includes="velocity-*.jar" />
> <fileset dir="path/to/cayenne-tools" includes="*.jar" />
> </path>
> <typedef resource="org/apache/cayenne/tools/antlib.xml">
> <classpath refid="cgen.classpath"/>
> </typedef>
> <target name="generate.entity.classes">
> <touch file="src/MyModel.map.xml" />
> <cgen map="src/MyModel.map.xml"
> superpkg="com.company.cayenne.auto"
> supertemplate="superclass.vm"
> template="subclass.vm"
> destDir="src"
> outputPattern="*.java"
> encoding="UTF-8"
> mode="all"
> />
> </target>
> 
> You may be able to add an eclipse "builder" to do it automatically - not
> sure..
> 
> 
> 2) I can't figure out how to get the modeler to build classes into the
>> right directories honoring packages.  It seems like if I choose the
>> "packages" option (I can't remember the specific name) it doesn't end up in
>> the right place.  I'm sure I just misunderstand the options.
>> 
> 
> Do you have the "Use package path" box checked at the bottom of the
> generate classes window?
> 
> 
>> 
>> 
>> -Lon
>> 


Mime
View raw message