db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Re: Maven, managing source code.
Date Wed, 03 Nov 2004 09:37:03 GMT
"Travis Stevens" <Travis.Stevens@noaa.gov> writes:

>Hello.

>The maven-torque-plugin is fantastic.  However, I am having trouble 
>managing the source.  Torque generates Base classes and blank Subclasses 
>of those for developers to add functionality for both Peer and Bean-like 
>objects.  For one table I end up with BaseTable.java, 
>BaseTablePeer.java, Table.java and TablePeer.java.  I then modify 
>Table.java for various reason.

Yep, this is how they are intented to be used.

>In this scenario, I would think that the best way to manage source code 
>is to check only Table.java into CVS.  That, along with the -schema.xml 
>files, I am able to easily regenerate the state.  However, this becomes 
>very messy because the generated classes are in the src directory.

I do this as follows:

src/java contains all the files that I write. It would contain (in your case)
the Table.java class.

I have a maven pre-goal in my maven.xml

<preGoal name="java:compile">
  <copy todir="target/src">
    <fileset dir="src/java"/>
  </copy>
</preGoal>

and

  <build>
    <sourceDirectory>target/src</sourceDirectory>
  </build>

in my project.xml

When I compile my app, this copies all the files into target/src and
then runs the torque:om target onto that directory. Files that already
exist (like the Table.java) will not be clobbered by the generator and
the resulting, merged tree will be compiled into target/classes.

(If you don't like this approach, please complain to the maven-dev
list (and especially one of the maven developers) about their
unwillingness to allow more than one java source directory to be
compiled and merged into target/classes.)

This is not the best of all possible solutions (and it especially
sucks regarding the ability to work on a source tree with Maven _and_
Eclipse) but it is the best I could come up with.

>I also use Axis wsdl2java maven plugin.  The axis plugin generates code 
>into the target directory which makes sense.  I would suggest Torque 
>move to this model.  If Table.java is not in the src directory, create 

Torque uses this model. Add

torque.java.dir =               target/src

to your project.properties. 

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

What is more important to you...
   [ ] Product Security
or [ ] Quality of Sales and Marketing Support
              -- actual question from a Microsoft customer survey

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


Mime
View raw message