Joined: Thu Aug 21, 2008 9:04 am Posts: 1 Location: India
|
Hi All,
I am using hibernate reverse engineering build script to create POJO apis.
The sample POJO apis generated is as follows:
/////////////////////////////////////////////////////
/**
* StAwardProfile generated by hbm2java
*/
@Entity
@Table(name="ST_AWARD_PROFILE" schema="SMAXQAINT" )
public class StAwardProfile implements java.io.Serializable {
private long awardProfileId;
private String awardName;
.....
}
/////////////////////////////////////////////////////
It is adding schema="SMAXQAINT" attribute in @Table annotation.
I do not want the schema attribute there as it will not work if the schema name is changed or for more than one schema in production.
Please let me know how to I remove this Schema attribute from POJO API.
Here is the Reverse engineering xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<table-filter match-schema="SMAXQAINT" match-name="ST_.*" package="com.maximus.stt.comp.schoolmax.student.model" />
ANT BUILD SCRIPT FILE:
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
<jdbcconfiguration configurationfile="${hibernateConfigdir}/hibernate.cfg.xml" revengfile="${hibernateConfigdir}/hibernate.reveng.xml" packagename="com.maximus.stt.comp.schoolmax.system.model"/>
<hbm2java jdk5="true" ejb3="true"/>
Hibernate-CFG.XML file contents:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database Connection Settings -->
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url">
jdbc:oracle:thin:@172.18.9.20:1521:SMAXDB
</property>
<property name="connection.username">SMAXQAINT</property>
<property name="connection.password">SMAXQAINT</property>
<!-- JDBC connection pool -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
Please let me know, what are changes so that i will not add schema tag inside the generated POJO api.
Thanks in advance.
Dinesh
|
|