Ok, no idea if this has come up before but I can't find it...
What I want is this,
I have a hbm mapping file with a few properties and a component. The properties map to single columns in my table and the component maps to 3 columns in my table. Now I want to link the component to a class from a library I downloaded from the net. Ok, all this works like it should. Problems start however when I want to use hibernate tools to generate the Pojo. The classes are generated without a problem. The only thing is that the component class is also generated. This I do not want because I already have this class in a jar file.
Is there a way to have the main class in a hbm generated by tools, but to exclude a component class from generation? I tried editting the ftl templates to this end, and I can make them so they don't create any ava code for the component, but still, the java file IS generated...
My HBM looks like this:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.ractoc.flux.mapper.persistence">
<class name="MapObjectDO" table="MAP_OBJECTS">
<meta attribute="generated-class" inherit="false">
com.ractoc.flux.persistence.base.MapObjectBaseDO
</meta>
<meta attribute="scope-class" inherit="true">
public abstract
</meta>
<id name="id" column="OBJ_ID" type="long" length="18">
<generator class="native">
<param name="sequence">SEQ_MAP_OBJECTS</param>
</generator>
</id>
<version type="timestamp" name="softlock"
column="PEQ_SOFTLOCK_TS" unsaved-value="undefined"
generated="never">
<meta attribute="property-type" inherit="true">
java.sql.Timestamp
</meta>
</version>
<property name="name" column="OBJ_NAME" type="string"
not-null="true" length="12" unique-key="MAP_OBJECTS_NAME_TYPE_UK" />
<property name="description" column="OBJ_DESC" type="string"
not-null="true" length="250" />
<property name="code" column="OBJ_CODE" type="string"
not-null="true" length="8" unique="true" />
<component name="location" class="com.jme.math.Vector3f" >
<property name="x" column="OBJ_LOC_X" type="float">
<meta attribute="gen-property">false</meta>
</property>
<property name="y" column="OBJ_LOC_Y" type="float">
<meta attribute="gen-property">false</meta>
</property>
<property name="z" column="OBJ_LOC_Z" type="float">
<meta attribute="gen-property">false</meta>
</property>
</component> </class>
</hibernate-mapping>
In this hbm, the com.jme.math.Vector3f is a class from an external jar. This jar is presento n the classpath of the ant task I'm using to create the java files.
Mark