hibernate subclass map 父類到子類時轉換出錯(大家幫下忙)(3)

dxadnwfn發表於2007-10-26
實體物件:
主表:
public class CreditInquiry implements Serializable {
private static final long serialVersionUID = 1L;

public static String REF = "CreditInquiry";
public static String PROP_TYPE = "type";
public static String PROP_TYPE_NAME = "typeName";
public static String PROP_NO = "no";
public static String PROP_CREATE_TIME = "createTime";
public static String PROP_UPDATE_TIME = "updateTime";
public static String PROP_ORGANIZATION_NO = "organizationNo";
public static String PROP_UPDATE_ORGANIZATION_NO = "updateOrganizationNo";
public static String PROP_STAFFER_NO = "stafferNo";
public static String PROP_UPDATE_STAFFER_NO = "updateStafferNo";
public static String PROP_ID = "Id";


private int hashCode = Integer.MIN_VALUE;

// primary key
private java.lang.Long id;

// fields
private java.lang.String type;
private java.lang.String typeName;
private java.lang.String no;
private java.util.Date createTime;
private java.util.Date updateTime;
private java.lang.String organizationNo;
private java.lang.String updateOrganizationNo;
private java.lang.String stafferNo;
private java.lang.String updateStafferNo;
...........
.............
}


子類..

public class CreditInquiryIndividualCustomer extends CreditInquiry implements Serializable {
private static final long serialVersionUID = 1L;

public static String REF = "CreditInquiryIndividualCustomer";
public static String PROP_NAME = "name";
public static String PROP_VALUE = "value";
public static String PROP_CREDIT_INQUIRY_ID = "CreditInquiryId";


private int hashCode = Integer.MIN_VALUE;

// collections
private java.util.Map properties;

......
......


}




我也問過同事,說這個表就不合理,這裡沒有父子關係,這裡沒有子類,這裡我把它看作子類的[類],其實是一個屬性而已..


請大家幫我分析一下..

相關文章