Hello world,
It seems thats doing hibernate's SQL request against my DB works
when i make it by hand : i got the expected result ( the good row) ...
Letting hibernate requesting by it own, i got and empty row ...
Hibernate version : hibernate-3.0beta2
Mapping documents:
<?xml version="1.0"?>
<!--
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
-->
<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.equant.ref_ce.bo.ReBO" table="REFCE_RE">
<id name="reIdCedre">
<column name="RE_ID_CEDRE" sql-type="integer"/>
<generator class="assigned"/>
</id>
<property name="reNom">
<column name="RE_NOM" sql-type="varchar2(40)"/>
</property>
<property name="reLibLong">
<column name="RE_LIB_LONG" sql-type="varchar2(50)"/>
</property>
<property name="reRaisonSociale">
<column name="RE_RAISON_SOCIALE" sql-type="varchar2(38)"/>
</property>
<property name="reSegmentClient">
<column name="RE_SEGMENT_CLIENT" sql-type="varchar2(10)"/>
</property>
<property name="reSensibilite">
<column name="RE_SENSIBILITE" sql-type="varchar2(20)"/>
</property>
<property name="reCscCedre">
<column name="RE_CSC_CEDRE" sql-type="varchar2(20)"/>
</property>
<property name="reIdRsc" type="big_decimal">
<column name="RE_ID_RSC"/>
</property>
<property name="reAssistRsc">
<column name="RE_ASSIST_RSC" sql-type="varchar2(50)"/>
</property>
<property name="reDecideur">
<column name="RE_DECIDEUR" sql-type="varchar2(50)"/>
</property>
<property name="reCrao">
<column name="RE_CRAO" sql-type="varchar2(50)"/>
</property>
<property name="reCommentaire">
<column name="RE_COMMENTAIRE" sql-type="varchar2(255)"/>
</property>
<property name="reDateCreate" type="timestamp">
<column name="RE_DATE_CREATE"/>
</property>
<set name="ReseauCompteBOSet"
inverse="true"
cascade="save-update">
<key column="RE_ID_CEDRE"/>
<one-to-many class="com.equant.ref_ce.bo.ReseauCompteBO"/>
</set>
<set name="produitCeBOSet"
inverse="true"
cascade="save-update">
<key column="RE_ID_CEDRE"/>
<one-to-many class="com.equant.ref_ce.bo.ProduitCeBO"/>
</set>
<set name="sousReseauBOSet"
inverse="true"
cascade="save-update">
<key column="SR_ID"/>
<one-to-many class="com.equant.ref_ce.bo.SousReseauBO"/>
</set>
<set name="arAliasReBOSet"
inverse="true"
cascade="save-update">
<key column="RE_ID_CEDRE"/>
<one-to-many class="com.equant.ref_ce.bo.ArAliasReBO"/>
</set>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
reIdCedre=new Integer(2147483647);
reBO = (ReBO) session.load(ReBO.class, reIdCedre);
Full stack trace of any exception that occurs::
No row with the given identifier exists: [com.equant.ref_ce.bo.ReBO#2147483647]
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.equant.ref_ce.bo.ReBO#2147483647]
at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:719)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:80)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:115)
at com.equant.ref_ce.bo.ReBO$$EnhancerByCGLIB$$2f6fae24.toString(<generated>)
at java.lang.String.valueOf(String.java:2131)
at java.lang.StringBuffer.append(StringBuffer.java:370)
at com.equant.ref_ce.dao.ReDataBaseManager.retrieveReByReIdCedre(ReDataBaseManager.java:85)
at com.equant.ref_ce.test.dao.TestSousReseauDataBaseManager.testSousReseauManager(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.equant.ref_ce.test.dao.TestCase.runTest(Unknown Source)
Name and version of the database you are using:
oracle 9i
The generated SQL (show_sql=true) and a little more ... :
[junit] 13:11:38,625 DEBUG DefaultLoadEventListener: loading entity: [com.equant.ref_ce.bo.ReBO#2147483647]
[junit] 13:11:38,625 DEBUG DefaultLoadEventListener: creating new proxy for entity
[junit] 13:11:38,625 DEBUG DefaultLoadEventListener: attempting to resolve: [com.equant.ref_ce.bo.ReBO#2147483647]
[junit] 13:11:38,625 DEBUG DefaultLoadEventListener: object not resolved in any cache: [com.equant.ref_ce.bo.ReBO#2147483647]
[junit] 13:11:38,625 DEBUG BasicEntityPersister: Materializing entity: [com.equant.ref_ce.bo.ReBO#2147483647]
[junit] 13:11:38,640 DEBUG AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] 13:11:38,640 DEBUG SQL: select rebo0_.RE_ID_CEDRE as RE_ID_CE1_0_, rebo0_.RE_NOM as RE_NOM6_0_, rebo0_.RE_LIB_LONG as RE_LIB_L3_6_0_, rebo0_.RE_RAISON_SOCIALE as RE_RAISO4_6_0_, rebo0_.RE_SEGMENT_CLIENT as RE_SEGME5_6_0_, rebo0_.RE_SENSIBILITE as RE_SENSI6_6_0_, rebo0_.RE_CSC_CEDRE as RE_CSC_C7_6_0_, rebo0_.RE_ID_RSC as RE_ID_RSC6_0_, rebo0_.RE_ASSIST_RSC as RE_ASSIS9_6_0_, rebo0_.RE_DECIDEUR as RE_DECI10_6_0_, rebo0_.RE_CRAO as RE_CRAO6_0_, rebo0_.RE_COMMENTAIRE as RE_COMM12_6_0_, rebo0_.RE_DATE_CREATE as RE_DATE13_6_0_ from REFCE_RE rebo0_ where rebo0_.RE_ID_CEDRE=?
[junit] Hibernate: select rebo0_.RE_ID_CEDRE as RE_ID_CE1_0_, rebo0_.RE_NOM as RE_NOM6_0_, rebo0_.RE_LIB_LONG as RE_LIB_L3_6_0_, rebo0_.RE_RAISON_SOCIALE as RE_RAISO4_6_0_, rebo0_.RE_SEGMENT_CLIENT as RE_SEGME5_6_0_, rebo0_.RE_SENSIBILITE as RE_SENSI6_6_0_, rebo0_.RE_CSC_CEDRE as RE_CSC_C7_6_0_, rebo0_.RE_ID_RSC as RE_ID_RSC6_0_, rebo0_.RE_ASSIST_RSC as RE_ASSIS9_6_0_, rebo0_.RE_DECIDEUR as RE_DECI10_6_0_, rebo0_.RE_CRAO as RE_CRAO6_0_, rebo0_.RE_COMMENTAIRE as RE_COMM12_6_0_, rebo0_.RE_DATE_CREATE as RE_DATE13_6_0_ from REFCE_RE rebo0_ where rebo0_.RE_ID_CEDRE=?
[junit] 13:11:38,640 DEBUG AbstractBatcher: preparing statement
[junit] 13:11:38,687 DEBUG IntegerType: binding '2147483647' to parameter: 1
[junit] 13:11:38,734 DEBUG AbstractBatcher: about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] 13:11:38,734 DEBUG Loader: Using naked result set
[junit] 13:11:38,734 DEBUG Loader: processing result set
[junit] 13:11:38,734 DEBUG Loader: done processing result set (0 rows)
[junit] 13:11:38,734 DEBUG AbstractBatcher: about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] 13:11:38,734 DEBUG AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] 13:11:38,734 DEBUG AbstractBatcher: closing statement
[junit] 13:11:38,734 DEBUG Loader: total objects hydrated: 0
[junit] 13:11:38,734 DEBUG PersistenceContext: initializing non-lazy collections
Where is the thing i don't understand so i got the ObjectNotFoundException doing it programaticaly ?
please help,
thx,
|