-hibernate 2.1.2 (DEBUG level)
-oracle 8i
sorry for my poor English...
Hello,
I have a problem with Oracle LONG column and joined-subclass:
----------------------------------
DATABASE script
----------------------------------
alter table DOSSIER_WEB drop constraint FK3FB03BA0217F38D0;
drop table DOSSIER cascade constraints;
drop table DOSSIER_WEB cascade constraints;
create table DOSSIER (
ID NUMBER(10,0) not null,
LABEL LONG,
primary key (ID)
);
create table DOSSIER_WEB (
PARENT_ID NUMBER(10,0) not null,
PK NUMBER(10,0),
MOT VARCHAR2(250),
primary key (PARENT_ID)
);
alter table DOSSIER_WEB add constraint FK3FB03BA0217F38D0 foreign key (PARENT_ID) references DOSSIER;
insert into DOSSIER values(1,'le label dans le LONG');
insert into DOSSIER_WEB values(1,1,'label2');
insert into DOSSIER values(2,'1 le label dans le LONG');
insert into DOSSIER_WEB values(2,2,'1 label2');
----------------------------------
MAPPING
----------------------------------
<class name="Dossier" table="DOSSIER">
<id column="ID" name="id" type="int" length="21" unsaved-value="0">
<generator class="assigned"/>
</id>
<property name="label" column="LABEL" type="string"/>
<joined-subclass name="DossierWeb" table="DOSSIER_WEB">
<key column="PARENT_ID"/>
<property name="pk" column="PK" length="21" type="integer"/>
<property name="mot" column="MOT" length="250" type="string"/>
</joined-subclass>
</class>
----------------------------------
OBJECT
----------------------------------
public class Dossier {
protected int id=0;
private String label;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}
public class DossierWeb extends Dossier{
private int pk=0;
private String mot;
public String getMot() {
return mot;
}
public void setMot(String mot) {
this.mot = mot;
}
public int getPk() {
return pk;
}
public void setPk(int pk) {
this.pk = pk;
}
}
----------------------------------
THE PROBLEM DESCRIPTION
----------------------------------
Query q = session.createQuery("from Dossier");// no problemo with "from DossierWeb" !!!!!!
List results = q.list();
the trace:
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Environment - Hibernate 2.1.2
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Environment - hibernate.properties not found
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.util.DTDEntityResolver - trying to locate
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.util.DTDEntityResolver - found
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - show_sql=true
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - connection.url=jdbc:oracle:thin:@serveur:1521:marco
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - connection.driver_class=oracle.jdbc.driver.OracleDriver
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - connection.username=david
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - connection.password=marcomp
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - dialect=net.sf.hibernate.dialect.OracleDialect
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@10da5eb [Attribute: name resource value "Dossier.hbm.xml"]
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Configuration - Mapping resource: Dossier.hbm.xml
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.util.DTDEntityResolver - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
05 mars 13:58:29 DEBUG [main] net.sf.hibernate.util.DTDEntityResolver - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
05 mars 13:58:29 INFO [main] net.sf.hibernate.cfg.Binder - Mapping class: Dossier -> DOSSIER
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Binder - Mapped property: id -> ID, type: integer
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Binder - Mapped property: label -> LABEL, type: string
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Binder - Mapping joined-subclass: DossierWeb -> DOSSIER_WEB
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Binder - Mapped property: pk -> PK, type: integer
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Binder - Mapped property: mot -> MOT, type: string
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Configuration - Configured SessionFactory: null
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Configuration - properties: ---------ZAPPED-----
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Configuration - processing one-to-one association property references
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Configuration - processing foreign key constraints
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.cfg.Configuration - resolving reference to class: Dossier
05 mars 13:58:30 INFO [main] net.sf.hibernate.dialect.Dialect - Using dialect: net.sf.hibernate.dialect.OracleDialect
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - Use outer join fetching: true
05 mars 13:58:30 INFO [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
05 mars 13:58:30 INFO [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
05 mars 13:58:30 INFO [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@serveur:1521:marco
05 mars 13:58:30 INFO [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=david, password=marcomp}
05 mars 13:58:30 INFO [main] net.sf.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:oracle:thin:@serveur:1521:marco, Isolation Level: 2
05 mars 13:58:30 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - Use scrollable result sets: true
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - Use JDBC3 getGeneratedKeys(): false
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: false
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - echoing all SQL to stdout
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - Query language substitutions: {}
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.SettingsFactory - cache provider: net.sf.ehcache.hibernate.Provider
05 mars 13:58:30 INFO [main] net.sf.hibernate.cfg.Configuration - instantiating and configuring caches
05 mars 13:58:31 INFO [main] net.sf.hibernate.impl.SessionFactoryImpl - building session factory
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties:---------ZAPPED-----
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionFactoryObjectFactory - registered: 4028886afb1b1a7800fb1b1a7abe0000 (unnamed)
05 mars 13:58:31 INFO [main] net.sf.hibernate.impl.SessionFactoryObjectFactory - no JNDI name configured
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionFactoryImpl - instantiated session factory
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - opened session
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - find: from Dossier
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.engine.QueryParameters - named parameters: {}
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.hql.QueryTranslator - compiling query
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - flushing session
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Flushing entities and processing referenced collections
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.impl.SessionImpl - Dont need to execute flush
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.hql.QueryTranslator - HQL: from Dossier
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.hql.QueryTranslator - SQL: select dossier0_.ID as ID, decode (dossier0_.ID, dossier0__1_.PARENT_ID, 1,0 ) as clazz_, dossier0_.LABEL as LABEL0_, dossier0__1_.PK as PK1_, dossier0__1_.MOT as MOT1_ from DOSSIER dossier0_, DOSSIER_WEB dossier0__1_ where dossier0_.ID=dossier0__1_.PARENT_ID(+)
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.SQL - select dossier0_.ID as ID, decode (dossier0_.ID, dossier0__1_.PARENT_ID, 1,0 ) as clazz_, dossier0_.LABEL as LABEL0_, dossier0__1_.PK as PK1_, dossier0__1_.MOT as MOT1_ from DOSSIER dossier0_, DOSSIER_WEB dossier0__1_ where dossier0_.ID=dossier0__1_.PARENT_ID(+)
Hibernate: select dossier0_.ID as ID, decode (dossier0_.ID, dossier0__1_.PARENT_ID, 1,0 ) as clazz_, dossier0_.LABEL as LABEL0_, dossier0__1_.PK as PK1_, dossier0__1_.MOT as MOT1_ from DOSSIER dossier0_, DOSSIER_WEB dossier0__1_ where dossier0_.ID=dossier0__1_.PARENT_ID(+)
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.loader.Loader - processing result set
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.type.IntegerType - returning '1' as column: ID
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.loader.Loader - result row: 1
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.type.IntegerType - returning '1' as column: clazz_
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.loader.Loader - Initializing object from ResultSet: 1
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.loader.Loader - Hydrating entity: DossierWeb#1
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.type.IntegerType - returning '1' as column: PK1_
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.type.StringType - returning 'label2' as column: MOT1_
05 mars 13:58:31 DEBUG [main] net.sf.hibernate.util.JDBCExceptionReporter - SQL Exception
java.sql.SQLException: Le flux de donn