Joined: Fri Feb 24, 2012 10:50 am Posts: 1
|
The following being observed:
While fetching super class the following logs are observed. The list has two values. One object has the correct reference other object has a error. using Hibernate 3.0
|isAcuSupported=Y||isEenabled=Y||origDocRequired=N||workTime=8||checkerId=null||dataPrivacy=Y||ustaxDocrequired=null||acReserve=N| |noOfCopies=null||canWaive=N||class=class com.citi.obt.data.CountryMaster_$$_javassist_434| |maxDeferDays=null||countryName=UNITED KINGDOM||canDefer=N| |hibernateLazyInitializer=org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer@2ca02ca| |hubId=null||countryIsoCode=GB||deferDays=30||lastAction=null||countryId=74|
||isAcuSupported=Y||isEenabled=Y||origDocRequired=N||workTime=8| |checkerId=null||ustaxDocrequired=null||dataPrivacy=Y||noOfCopies=null||acReserve=N||canWaive=N| |class=class com.citi.obt.data.CountryMaster||maxDeferDays=null||countryName=NETHERLANDS| |canDefer=N||hubId=null||countryIsoCode=NL||deferDays=30||lastAction=null||countryId=163||]
---------------------------
public class CountryMaster extends BaseCountryMaster { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L;
/*[CONSTRUCTOR MARKER BEGIN]*/ /** * Instantiates a new country master. */ public CountryMaster () { super(); }
/** * Constructor for primary key. * * @param countryId the country id */ public CountryMaster (long countryId) { super(countryId); }
/*[CONSTRUCTOR MARKER END]*/ } -------------------------- /* public abstract class BaseCountryMaster implements Serializable {
/** The REF. */ public static String REF = "CountryMaster"; /** The PRO p_ wor k_ time. */ public static String PROP_WORK_TIME = "workTime"; /** The PRO p_ dat a_ privacy. */ public static String PROP_DATA_PRIVACY = "dataPrivacy"; /** The PRO p_ ca n_ waive. */ public static String PROP_CAN_WAIVE = "canWaive"; /** The PRO p_ countr y_ is o_ code. */ public static String PROP_COUNTRY_ISO_CODE = "countryIsoCode"; /** The PRO p_ a c_ reserve. */ public static String PROP_AC_RESERVE = "acReserve"; /** The PRO p_ ori g_ do c_ required. */ public static String PROP_ORIG_DOC_REQUIRED = "origDocRequired"; /** The PRO p_ countr y_ id. */ public static String PROP_COUNTRY_ID = "countryId"; /** The PRO p_ checke r_ id. */ public static String PROP_CHECKER_ID = "checkerId"; /** The PRO p_ las t_ action. */ public static String PROP_LAST_ACTION = "lastAction"; /** The PRO p_ n o_ o f_ copies. */ public static String PROP_NO_OF_COPIES = "noOfCopies"; /** The PRO p_ usta x_ docrequired. */ public static String PROP_USTAX_DOCREQUIRED = "ustaxDocrequired"; /** The PRO p_ defe r_ days. */ public static String PROP_DEFER_DAYS = "deferDays"; /** The PRO p_ ma x_ defe r_ days. */ public static String PROP_MAX_DEFER_DAYS = "maxDeferDays"; /** The PRO p_ ca n_ defer. */ public static String PROP_CAN_DEFER = "canDefer"; /** The PRO p_ countr y_ name. */ public static String PROP_COUNTRY_NAME = "countryName"; public static String PROP_E_ENABLED = "isEenabled"; public static String PROP_HUB_ID = "hubId"; // constructors /** * Instantiates a new base country master. */ public BaseCountryMaster () { initialize(); }
/** * Constructor for primary key. * * @param countryId the country id */ public BaseCountryMaster (long countryId) { this.setCountryId(countryId); initialize(); }
/** * Initialize. */ protected void initialize () {}
/** The hash code. */ private int hashCode = Integer.MIN_VALUE;
// primary key /** The country id. */ private long countryId;
// fields /** The country iso code. */ private java.lang.String countryIsoCode; /** The country name. */ private java.lang.String countryName; /** The data privacy. */ private java.lang.String dataPrivacy; /** The can waive. */ private java.lang.String canWaive; /** The can defer. */ private java.lang.String canDefer; /** The defer days. */ private java.lang.Long deferDays; /** The max defer days. */ private java.lang.Long maxDeferDays; /** The ac reserve. */ private java.lang.String acReserve; /** The orig doc required. */ private java.lang.String origDocRequired; /** The no of copies. */ private java.lang.Long noOfCopies; /** The ustax docrequired. */ private java.lang.String ustaxDocrequired; /** The last action. */ private java.util.Date lastAction; /** The checker id. */ private java.lang.String checkerId; /** The work time. */ private java.lang.Long workTime; private java.lang.Character isAcuSupported; private java.lang.Character isEenabled; private java.lang.Long hubId;
/** * Return the unique identifier of this class. * * @return the country id * * @hibernate.id * generator-class="assigned" * column="COUNTRY_ID" */ public long getCountryId () { return countryId; }
/** * Set the unique identifier of this class. * * @param countryId the new ID */ public void setCountryId (long countryId) { this.countryId = countryId; this.hashCode = Integer.MIN_VALUE; }
public java.lang.Character getIsEenabled() { return isEenabled; }
public void setIsEenabled(java.lang.Character isEenabled) { this.isEenabled = isEenabled; }
public java.lang.Character getIsAcuSupported() { return isAcuSupported; }
public void setIsAcuSupported(java.lang.Character isAcuSupported) { this.isAcuSupported = isAcuSupported; }
/** * Return the value associated with the column: COUNTRY_ISO_CODE. * * @return the country iso code */ public java.lang.String getCountryIsoCode () { return countryIsoCode; }
/** * Set the value related to the column: COUNTRY_ISO_CODE. * * @param countryIsoCode the COUNTRY_ISO_CODE value */ public void setCountryIsoCode (java.lang.String countryIsoCode) { this.countryIsoCode = countryIsoCode; }
/** * Return the value associated with the column: COUNTRY_NAME. * * @return the country name */ public java.lang.String getCountryName () { return countryName; }
/** * Set the value related to the column: COUNTRY_NAME. * * @param countryName the COUNTRY_NAME value */ public void setCountryName (java.lang.String countryName) { this.countryName = countryName; }
/** * Return the value associated with the column: DATA_PRIVACY. * * @return the data privacy */ public java.lang.String getDataPrivacy () { return dataPrivacy; }
/** * Set the value related to the column: DATA_PRIVACY. * * @param dataPrivacy the DATA_PRIVACY value */ public void setDataPrivacy (java.lang.String dataPrivacy) { this.dataPrivacy = dataPrivacy; }
/** * Return the value associated with the column: CAN_WAVE. * * @return the can waive */ public java.lang.String getCanWaive () { return canWaive; }
/** * Set the value related to the column: CAN_WAVE. * * @param canWaive the CAN_WAVE value */ public void setCanWaive (java.lang.String canWaive) { this.canWaive = canWaive; }
/** * Return the value associated with the column: CAN_DEFER. * * @return the can defer */ public java.lang.String getCanDefer () { return canDefer; }
/** * Set the value related to the column: CAN_DEFER. * * @param canDefer the CAN_DEFER value */ public void setCanDefer (java.lang.String canDefer) { this.canDefer = canDefer; }
/** * Return the value associated with the column: DEFER_DAYS. * * @return the defer days */ public java.lang.Long getDeferDays () { return deferDays; }
/** * Set the value related to the column: DEFER_DAYS. * * @param deferDays the DEFER_DAYS value */ public void setDeferDays (java.lang.Long deferDays) { this.deferDays = deferDays; }
/** * Return the value associated with the column: MAX_DEFER_DAYS. * * @return the max defer days */ public java.lang.Long getMaxDeferDays () { return maxDeferDays; }
/** * Set the value related to the column: MAX_DEFER_DAYS. * * @param maxDeferDays the MAX_DEFER_DAYS value */ public void setMaxDeferDays (java.lang.Long maxDeferDays) { this.maxDeferDays = maxDeferDays; }
/** * Return the value associated with the column: AC_RESERVE. * * @return the ac reserve */ public java.lang.String getAcReserve () { return acReserve; }
/** * Set the value related to the column: AC_RESERVE. * * @param acReserve the AC_RESERVE value */ public void setAcReserve (java.lang.String acReserve) { this.acReserve = acReserve; }
/** * Return the value associated with the column: ORIG_DOC_REQUIRED. * * @return the orig doc required */ public java.lang.String getOrigDocRequired () { return origDocRequired; }
/** * Set the value related to the column: ORIG_DOC_REQUIRED. * * @param origDocRequired the ORIG_DOC_REQUIRED value */ public void setOrigDocRequired (java.lang.String origDocRequired) { this.origDocRequired = origDocRequired; }
/** * Return the value associated with the column: NUMBER_OF_COPIES. * * @return the no of copies */ public java.lang.Long getNoOfCopies () { return noOfCopies; }
/** * Set the value related to the column: NUMBER_OF_COPIES. * * @param noOfCopies the NUMBER_OF_COPIES value */ public void setNoOfCopies (java.lang.Long noOfCopies) { this.noOfCopies = noOfCopies; }
/** * Return the value associated with the column: USTAX_DOCREQUIRED. * * @return the ustax docrequired */ public java.lang.String getUstaxDocrequired () { return ustaxDocrequired; }
/** * Set the value related to the column: USTAX_DOCREQUIRED. * * @param ustaxDocrequired the USTAX_DOCREQUIRED value */ public void setUstaxDocrequired (java.lang.String ustaxDocrequired) { this.ustaxDocrequired = ustaxDocrequired; }
/** * Return the value associated with the column: LAST_ACTION. * * @return the last action */ public java.util.Date getLastAction () { return lastAction; }
/** * Set the value related to the column: LAST_ACTION. * * @param lastAction the LAST_ACTION value */ public void setLastAction (java.util.Date lastAction) { this.lastAction = lastAction; }
/** * Return the value associated with the column: CHECKER_ID. * * @return the checker id */ public java.lang.String getCheckerId () { return checkerId; }
/** * Set the value related to the column: CHECKER_ID. * * @param checkerId the CHECKER_ID value */ public void setCheckerId (java.lang.String checkerId) { this.checkerId = checkerId; }
/** * Return the value associated with the column: WORK_TIME. * * @return the work time */ public java.lang.Long getWorkTime () { return workTime; }
/** * Set the value related to the column: WORK_TIME. * * @param workTime the WORK_TIME value */ public void setWorkTime (java.lang.Long workTime) { this.workTime = workTime; }
/* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals (Object obj) { if (null == obj) return false; if (!(obj instanceof com.citi.obt.data.CountryMaster)) return false; else { com.citi.obt.data.CountryMaster countryMaster = (com.citi.obt.data.CountryMaster) obj; return (this.getCountryId() == countryMaster.getCountryId()); } }
/* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode () { if (Integer.MIN_VALUE == this.hashCode) { return (int) this.getCountryId(); } return this.hashCode; }
/* (non-Javadoc) * @see java.lang.Object#toString() */ public String toString () { return super.toString(); }
/** * @return the hubId */ public java.lang.Long getHubId() { return hubId; }
/** * @param hubId the hubId to set */ public void setHubId(java.lang.Long hubId) { this.hubId = hubId; }
} ================= <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="aa"> <class name="CountryMaster" table="COUNTRY_MASTER"> <meta attribute="sync-DAO">true</meta>
<id name="countryId" column="COUNTRY_ID" type="long" length="9"> <generator class="assigned" /> </id> <property name="countryIsoCode" column="COUNTRY_ISO_CODE" type="string" not-null="false" length="10" /> <property name="countryName" column="COUNTRY_NAME" type="string" not-null="false" length="50" /> <property name="dataPrivacy" column="DATA_PRIVACY" type="string" not-null="false" length="1" /> <property name="canWaive" column="CAN_WAVE" type="string" not-null="false" length="1" /> <property name="canDefer" column="CAN_DEFER" type="string" not-null="false" length="1" /> <property name="deferDays" column="DEFER_DAYS" type="java.lang.Long" not-null="false" length="4" /> <property name="maxDeferDays" column="MAX_DEFER_DAYS" type="java.lang.Long" not-null="false" length="4" /> <property name="acReserve" column="AC_RESERVE" type="string" not-null="false" length="1" /> <property name="origDocRequired" column="ORIG_DOC_REQUIRED" type="string" not-null="false" length="1" /> <property name="noOfCopies" column="NUMBER_OF_COPIES" type="java.lang.Long" not-null="false" length="3" /> <property name="ustaxDocrequired" column="USTAX_DOCREQUIRED" type="string" not-null="false" length="1" /> <property name="lastAction" column="LAST_ACTION" type="date" not-null="false" length="7" /> <property name="checkerId" column="CHECKER_ID" type="string" not-null="false" length="10" /> <property name="workTime" column="WORK_TIME" type="java.lang.Long" not-null="false" length="4" />
<property name="isAcuSupported" column="IS_ACU_SUPPORTED" type="java.lang.Character" not-null="false" length="1" />
<property name="isEenabled" column="IS_E_ENABLED" type="java.lang.Character" not-null="false" length="1" />
<property name="hubId" column="HUB_ID" type="java.lang.Long" not-null="false" precision="15" />
</class> </hibernate-mapping>
============== dao call
Criteria criteria = super.getSession().createCriteria(CountryMaster.class).add(Restrictions.in(CountryMaster.PROP_COUNTRY_ID, _countryIds)); countryList = criteria.list();
|
|