连接数据库A 生成形如:
 */public class CustAddress implements java.io.Serializable { // Fields private CustAddressId id; // Constructors /** default constructor */
public CustAddress() {
} /** full constructor */
public CustAddress(CustAddressId id) {
this.id = id;
} // Property accessors public CustAddressId getId() {
return this.id;
} public void setId(CustAddressId id) {
this.id = id;
}}public class CustAddressId implements java.io.Serializable { // Fields private Long custno;
private String streetAddress;
private String postalCode;
private String city;
private String stateProvince;
private String countryId; // Constructors /** default constructor */
public CustAddressId() {
} /** full constructor */
public CustAddressId(Long custno, String streetAddress, String postalCode,
String city, String stateProvince, String countryId) {
this.custno = custno;
this.streetAddress = streetAddress;
this.postalCode = postalCode;
this.city = city;
this.stateProvince = stateProvince;
this.countryId = countryId;
} // Property accessors public Long getCustno() {
return this.custno;
} public void setCustno(Long custno) {
this.custno = custno;
} public String getStreetAddress() {
return this.streetAddress;
} public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
} public String getPostalCode() {
return this.postalCode;
} public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
} public String getCity() {
return this.city;
} public void setCity(String city) {
this.city = city;
} public String getStateProvince() {
return this.stateProvince;
} public void setStateProvince(String stateProvince) {
this.stateProvince = stateProvince;
} public String getCountryId() {
return this.countryId;
} public void setCountryId(String countryId) {
this.countryId = countryId;
} public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof CustAddressId))
return false;
CustAddressId castOther = (CustAddressId) other; return ((this.getCustno() == castOther.getCustno()) || (this
.getCustno() != null
&& castOther.getCustno() != null && this.getCustno().equals(
castOther.getCustno())))
&& ((this.getStreetAddress() == castOther.getStreetAddress()) || (this
.getStreetAddress() != null
&& castOther.getStreetAddress() != null && this
.getStreetAddress()
.equals(castOther.getStreetAddress())))
&& ((this.getPostalCode() == castOther.getPostalCode()) || (this
.getPostalCode() != null
&& castOther.getPostalCode() != null && this
.getPostalCode().equals(castOther.getPostalCode())))
&& ((this.getCity() == castOther.getCity()) || (this.getCity() != null
&& castOther.getCity() != null && this.getCity()
.equals(castOther.getCity())))
&& ((this.getStateProvince() == castOther.getStateProvince()) || (this
.getStateProvince() != null
&& castOther.getStateProvince() != null && this
.getStateProvince()
.equals(castOther.getStateProvince())))
&& ((this.getCountryId() == castOther.getCountryId()) || (this
.getCountryId() != null
&& castOther.getCountryId() != null && this
.getCountryId().equals(castOther.getCountryId())));
} public int hashCode() {
int result = 17; result = 37 * result
+ (getCustno() == null ? 0 : this.getCustno().hashCode());
result = 37
* result
+ (getStreetAddress() == null ? 0 : this.getStreetAddress()
.hashCode());
result = 37
* result
+ (getPostalCode() == null ? 0 : this.getPostalCode()
.hashCode());
result = 37 * result
+ (getCity() == null ? 0 : this.getCity().hashCode());
result = 37
* result
+ (getStateProvince() == null ? 0 : this.getStateProvince()
.hashCode());
result = 37 * result
+ (getCountryId() == null ? 0 : this.getCountryId().hashCode());
return result;
}}
<hibernate-mapping>
    <class name="com.hp.entry.CustAddress" table="CUST_ADDRESS" schema="SPLDATA">
        <composite-id name="id" class="com.hp.entry.CustAddressId">
            <key-property name="custno" type="java.lang.Long">
                <column name="CUSTNO" precision="10" scale="0" />
            </key-property>
            <key-property name="streetAddress" type="java.lang.String">
                <column name="STREET_ADDRESS" length="40" />
            </key-property>
            <key-property name="postalCode" type="java.lang.String">
                <column name="POSTAL_CODE" length="10" />
            </key-property>
            <key-property name="city" type="java.lang.String">
                <column name="CITY" length="30" />
            </key-property>
            <key-property name="stateProvince" type="java.lang.String">
                <column name="STATE_PROVINCE" length="2" />
            </key-property>
            <key-property name="countryId" type="java.lang.String">
                <column name="COUNTRY_ID" length="2" />
            </key-property>
        </composite-id>
    </class>
</hibernate-mapping>
而连接数据库B生成形如:
<hibernate-mapping>
    <class name="com.hp.entry.Testusers" table="TESTUSERS" schema="SPLDATA">
        <id name="id" type="java.lang.Integer">
            <column name="ID" precision="8" scale="0" />
            <generator class="native" />
        </id>
        <property name="userid" type="java.lang.String">
            <column name="USERID" length="50" not-null="true" unique="true" />
        </property>
        <property name="password" type="java.lang.String">
            <column name="PASSWORD" length="20" not-null="true" />
        </property>
        <property name="purview" type="java.lang.String">
            <column name="PURVIEW" length="1000" />
        </property>
        <property name="fdipost" type="java.math.BigDecimal">
            <column name="FDIPOST" precision="22" scale="0" not-null="true" />
        </property>
    </class>
</hibernate-mapping>
比对两边建表SQL发现略有不同 ,有什么比较好的办法让数据库A能映射形如B格式的配置文件,不生成带ID的JAVABEAN??