Hey,
i search the whole day, but i still don't know what to do,
that the tables i define in the hibernate class with xdoclet tags are automatically createt!
i have my class:
Code:
/**
* @author jm
* @hibernate.class table="KVT"
*/
public class KeyValueTuple {
private Long uniqueSequence;
private String Tkey;
private String value; //temporary String (->Object)
public KeyValueTuple() {
}
public void setUniqueSequence(Long puniqueSequence) {
uniqueSequence=puniqueSequence;
}
/**@hibernate.id generator-class="native" */
public Long getUniqueSequence() {
return uniqueSequence;
}
/**@param pKey
*
* */
public void setTKey(String pKey) {
Tkey = pKey;
}
/**
* @hibernate.property
* @return String
*/
public String getTKey() {
return Tkey;
}
/** @param pValue */
public void setValue(String pValue) {
value = pValue;
}
the generated mapping:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 1.1//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="org.weta.jas.hibernate.KeyValueTuple"
table="KVT"
>
<id
name="uniqueSequence"
column="uniqueSequence"
type="java.lang.Long"
unsaved-value="any"
>
<generator class="native">
</generator>
</id>
<property
name="TKey"
type="java.lang.String"
column="TKey"
/>
<property
name="value"
type="java.lang.String"
column="value"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-KeyValueTuple.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
the jboss-service.xml
Code:
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,
name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=WetaDS</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">mappings/Attribute.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/WetaDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">false</attribute>
<attribute name="UserTransactionName">java:/UserTransaction</attribute>
</mbean>
</server>
and the hibernate-configuration:
Code:
<hibernate-configuration>
<session-factory>
<!-- Use a Tomcat JNDI datasource -->
<property name="connection.datasource">java:/WetaDS</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<mapping resource="mappings/KeyValueTuple.hbm.xml"/>
</session-factory>
</hibernate-configuration>
i deploy my .sar in jboss, but the tables won't be created
Can anybody say , what to do?
thanx
N8chtschwaermer