-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Bug: tries to persist unmapped subclass property sometimes
PostPosted: Mon Nov 03, 2003 7:10 pm 
Newbie

Joined: Mon Nov 03, 2003 1:46 pm
Posts: 2
I have run into a case where Hibernate is trying to persist a property that is not mapped in the hbm.xml file. The example works if you rename the property to not have a Java beans signature, or you remove the one-to-many association from manager to employee.

A small test case is:

1) Manager.java
import java.util.Collection;

public class Manager extends Employee {
private Collection reports;

public Boolean isManager() {
return Boolean.TRUE;
}

public Collection getReports() {
return reports;
}

public void setReports(Collection reports) {
this.reports = reports;
}

}
---
2) Employee.java

public class Employee {
private Long id;
private Manager manager;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Boolean isManager() {
return Boolean.FALSE;
}

public Manager getManager() {
return manager;
}

public void setManager(Manager manager) {
this.manager = manager;
}

}

---
3) Test.java

import junit.framework.TestCase;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.MappingException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;

public class Test extends TestCase {
public Test(String name) {
super(name);
}

public static void main(String args[]) {
new Test("test").testNewDerived();
}

public void testNewDerived() {
try {
Configuration config = new Configuration().addClass(Employee.class);

SessionFactory sessions = config.buildSessionFactory();
Session session = sessions.openSession();
Transaction txn = session.beginTransaction();

Manager derived = new Manager();
session.save(derived);
txn.commit();
} catch (MappingException e) {
e.printStackTrace();
} catch (HibernateException e) {
e.printStackTrace();
}
}
}

---
4) Employee.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Employee" table="test_bug" discriminator-value="false">
<id name="id">
<generator class="increment"/>
</id>
<discriminator column="manager_flg" type="boolean"/>
<many-to-one name="manager" column="reports_to" class="Manager"/>

<subclass name="Manager" discriminator-value="true">
<set name="reports" lazy="true">
<key column="reports_to"/>
<one-to-many class="Employee"/>
</set>
</subclass>
</class>
</hibernate-mapping>

---
Here is the DDL to create the single test table required:

CREATE TABLE TEST_BUG
(
ID NUMBER NOT NULL,
MANAGER_FLG NUMBER,
REPORTS_TO NUMBER
)
---

The test case hits a MappingException when it tries to persist Boolean (for isManager). Here is the output from running the test case including TRACE output:
2003-11-03 15:03:18,900 INFO Environment.<clinit> - Hibernate 2.1 beta 5
2003-11-03 15:03:18,900 INFO Environment.<clinit> - Hibernate 2.1 beta 5
2003-11-03 15:03:18,963 INFO Environment.<clinit> - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, hibernate.connection.username=scott, hibernate.connection.url=jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, hibernate.show_sql=false, hibernate.connection.password=tiger, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.statement_cache.size=25, hibernate.connection.pool_size=1}
2003-11-03 15:03:18,963 INFO Environment.<clinit> - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, hibernate.connection.username=scott, hibernate.connection.url=jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, hibernate.show_sql=false, hibernate.connection.password=tiger, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.statement_cache.size=25, hibernate.connection.pool_size=1}
2003-11-03 15:03:19,010 INFO Environment.<clinit> - using java.io streams to persist binary types
2003-11-03 15:03:19,010 INFO Environment.<clinit> - using java.io streams to persist binary types
2003-11-03 15:03:19,010 INFO Environment.<clinit> - using CGLIB reflection optimizer
2003-11-03 15:03:19,010 INFO Environment.<clinit> - using CGLIB reflection optimizer
2003-11-03 15:03:19,025 INFO Configuration.addClass - Mapping resource: Employee.hbm.xml
2003-11-03 15:03:19,025 INFO Configuration.addClass - Mapping resource: Employee.hbm.xml
2003-11-03 15:03:19,854 INFO Binder.bindRootClass - Mapping class: Employee -> test_bug
2003-11-03 15:03:19,854 INFO Binder.bindRootClass - Mapping class: Employee -> test_bug
2003-11-03 15:03:19,947 DEBUG Binder.bindProperty - Mapped property: id -> id, type: long
2003-11-03 15:03:19,947 DEBUG Binder.bindProperty - Mapped property: id -> id, type: long
2003-11-03 15:03:19,963 DEBUG Binder.bindProperty - Mapped property: manager -> reports_to, type: Manager
2003-11-03 15:03:19,963 DEBUG Binder.bindProperty - Mapped property: manager -> reports_to, type: Manager
2003-11-03 15:03:20,025 INFO Binder.bindSubclass - Mapping subclass: Manager -> test_bug
2003-11-03 15:03:20,025 INFO Binder.bindSubclass - Mapping subclass: Manager -> test_bug
2003-11-03 15:03:20,072 DEBUG Binder.bindProperty - Mapped property: reports, type: java.util.Set
2003-11-03 15:03:20,072 DEBUG Binder.bindProperty - Mapped property: reports, type: java.util.Set
2003-11-03 15:03:20,072 INFO Configuration.secondPassCompile - processing one-to-many association mappings
2003-11-03 15:03:20,072 INFO Configuration.secondPassCompile - processing one-to-many association mappings
2003-11-03 15:03:20,072 DEBUG Binder.doSecondPass - Second pass for collection: Manager.reports
2003-11-03 15:03:20,072 DEBUG Binder.doSecondPass - Second pass for collection: Manager.reports
2003-11-03 15:03:20,072 INFO Binder.bindCollectionSecondPass - Mapping collection: Manager.reports -> test_bug
2003-11-03 15:03:20,072 INFO Binder.bindCollectionSecondPass - Mapping collection: Manager.reports -> test_bug
2003-11-03 15:03:20,088 DEBUG Binder.doSecondPass - Mapped collection key: reports_to, one-to-many: Employee
2003-11-03 15:03:20,088 DEBUG Binder.doSecondPass - Mapped collection key: reports_to, one-to-many: Employee
2003-11-03 15:03:20,088 INFO Configuration.secondPassCompile - processing one-to-one association property references
2003-11-03 15:03:20,088 INFO Configuration.secondPassCompile - processing one-to-one association property references
2003-11-03 15:03:20,088 INFO Configuration.secondPassCompile - processing foreign key constraints
2003-11-03 15:03:20,088 INFO Configuration.secondPassCompile - processing foreign key constraints
2003-11-03 15:03:20,088 DEBUG Configuration.secondPassCompile - resolving reference to class: Manager
2003-11-03 15:03:20,088 DEBUG Configuration.secondPassCompile - resolving reference to class: Manager
2003-11-03 15:03:20,119 INFO Dialect.<init> - Using dialect: net.sf.hibernate.dialect.OracleDialect
2003-11-03 15:03:20,119 INFO Dialect.<init> - Using dialect: net.sf.hibernate.dialect.OracleDialect
2003-11-03 15:03:20,119 INFO SettingsFactory.buildSettings - Use outer join fetching: true
2003-11-03 15:03:20,119 INFO SettingsFactory.buildSettings - Use outer join fetching: true
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - Using Hibernate built-in connection pool (not for production use!)
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - Using Hibernate built-in connection pool (not for production use!)
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - Hibernate connection pool size: 1
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - Hibernate connection pool size: 1
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - connection properties: {user=scott, password=tiger}
2003-11-03 15:03:20,135 INFO DriverManagerConnectionProvider.configure - connection properties: {user=scott, password=tiger}
2003-11-03 15:03:20,150 INFO TransactionFactoryFactory.buildTransactionFactory - Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
2003-11-03 15:03:20,150 INFO TransactionFactoryFactory.buildTransactionFactory - Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
2003-11-03 15:03:20,150 INFO TransactionManagerLookupFactory.getTransactionManagerLookup - No TransactionManagerLookup configured (use of process level read-write cache is not recommended)
2003-11-03 15:03:20,150 INFO TransactionManagerLookupFactory.getTransactionManagerLookup - No TransactionManagerLookup configured (use of process level read-write cache is not recommended)
2003-11-03 15:03:20,150 DEBUG DriverManagerConnectionProvider.getConnection - total checked-out connections: 0
2003-11-03 15:03:20,150 DEBUG DriverManagerConnectionProvider.getConnection - total checked-out connections: 0
2003-11-03 15:03:20,150 DEBUG DriverManagerConnectionProvider.getConnection - opening new JDBC connection
2003-11-03 15:03:20,150 DEBUG DriverManagerConnectionProvider.getConnection - opening new JDBC connection
2003-11-03 15:03:20,775 DEBUG DriverManagerConnectionProvider.getConnection - created connection to: jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, Isolation Level: 2
2003-11-03 15:03:20,775 DEBUG DriverManagerConnectionProvider.getConnection - created connection to: jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, Isolation Level: 2
2003-11-03 15:03:20,775 DEBUG DriverManagerConnectionProvider.closeConnection - returning connection to pool, pool size: 1
2003-11-03 15:03:20,775 DEBUG DriverManagerConnectionProvider.closeConnection - returning connection to pool, pool size: 1
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - Use scrollable result sets: true
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - Use scrollable result sets: true
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - Query language substitutions: {no='N', true=1, yes='Y', false=0}
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - Query language substitutions: {no='N', true=1, yes='Y', false=0}
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - cache provider: net.sf.hibernate.cache.JCSCacheProvider
2003-11-03 15:03:20,775 INFO SettingsFactory.buildSettings - cache provider: net.sf.hibernate.cache.JCSCacheProvider
2003-11-03 15:03:20,791 INFO Configuration.configureCaches - instantiating and configuring caches
2003-11-03 15:03:20,791 INFO Configuration.configureCaches - instantiating and configuring caches
2003-11-03 15:03:20,947 INFO SessionFactoryImpl.<init> - building session factory
2003-11-03 15:03:20,947 INFO SessionFactoryImpl.<init> - building session factory
2003-11-03 15:03:20,947 DEBUG SessionFactoryImpl.<init> - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=tiger, sun.boot.library.path=c:\j2sdk1.4.1_03\jre\bin, java.vm.version=1.4.1_03-b02, hibernate.connection.username=scott, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\devel\test\hibernateBug, java.runtime.version=1.4.1_03-b02, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=c:\j2sdk1.4.1_03\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\bodkin1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.java2d.fontpath=, java.library.path=c:\j2sdk1.4.1_03\bin;.;C:\WINNT\system32;C:\WINNT;D:\oracle\ora92\bin;c:\j2sdk1.4.1_03\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\F-Secure\Ssh;C:\Program Files\F-Secure\Ssh;C:\Program Files\COMMON~1\Odbc\FILEMA~1;D:\oracle\ora92\bin;c:\j2sdk1.4.1_03\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\F-Secure\Ssh;C:\Program Files\F-Secure\Ssh;C:\Program Files\COMMON~1\Odbc\FILEMA~1;;c:\maven-1.0-beta-7\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.connection.pool_size=1, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.0, user.home=C:\Documents and Settings\bodkin1, user.timezone=America/Los_Angeles, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, java.class.path=C:/eclipse/plugins/org.eclipse.jdt.junit_3.0.0/junitsupport.jar;C:/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.0.0/junitruntime.jar;D:\devel\test\hibernateBug;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\cglib-asm.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\classes12-9.2.0.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-beanutils.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-collections.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-dbcp.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-lang.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-logging.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-pool.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\datatags-9.0.3.10.35.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\dom4j.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\jdbc2_0-stdext.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\jstl.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\nls_charset12-9.2.0.2.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\odmg.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\standard.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\struts.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\taglibs-log.jar;C:\eclipse\plugins\org.junit_3.8.1\junit.jar;C:\maven-1.0-beta-7\repository\log4j\jars\log4j-1.2.8.jar;D:\devel\lib\hibernate-2.1\lib\jgroups.jar;D:\devel\lib\hibernate-2.1\lib\jta.jar;D:\devel\lib\hibernate-2.1\hibernate2.jar, user.name=bodkin1, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.show_sql=false, java.vm.specification.version=1.0, java.home=c:\j2sdk1.4.1_03\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.connection.url=jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, hibernate.jdbc.use_streams_for_binary=true, java.version=1.4.1_03, java.ext.dirs=c:\j2sdk1.4.1_03\jre\lib\ext, sun.boot.class.path=c:\j2sdk1.4.1_03\jre\lib\endorsed\xalan-2.3.1.jar;c:\j2sdk1.4.1_03\jre\lib\endorsed\xercesImpl-2.0.0.jar;c:\j2sdk1.4.1_03\jre\lib\endorsed\xml-apis.jar;c:\j2sdk1.4.1_03\jre\lib\rt.jar;c:\j2sdk1.4.1_03\jre\lib\i18n.jar;c:\j2sdk1.4.1_03\jre\lib\sunrsasign.jar;c:\j2sdk1.4.1_03\jre\lib\jsse.jar;c:\j2sdk1.4.1_03\jre\lib\jce.jar;c:\j2sdk1.4.1_03\jre\lib\charsets.jar;c:\j2sdk1.4.1_03\jre\classes, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_size=0, file.separator=\, hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.statement_cache.size=25, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.cpu.isalist=pentium i486 i386}
2003-11-03 15:03:20,947 DEBUG SessionFactoryImpl.<init> - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=tiger, sun.boot.library.path=c:\j2sdk1.4.1_03\jre\bin, java.vm.version=1.4.1_03-b02, hibernate.connection.username=scott, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\devel\test\hibernateBug, java.runtime.version=1.4.1_03-b02, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=c:\j2sdk1.4.1_03\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\bodkin1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.java2d.fontpath=, java.library.path=c:\j2sdk1.4.1_03\bin;.;C:\WINNT\system32;C:\WINNT;D:\oracle\ora92\bin;c:\j2sdk1.4.1_03\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\F-Secure\Ssh;C:\Program Files\F-Secure\Ssh;C:\Program Files\COMMON~1\Odbc\FILEMA~1;D:\oracle\ora92\bin;c:\j2sdk1.4.1_03\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\F-Secure\Ssh;C:\Program Files\F-Secure\Ssh;C:\Program Files\COMMON~1\Odbc\FILEMA~1;;c:\maven-1.0-beta-7\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.connection.pool_size=1, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.0, user.home=C:\Documents and Settings\bodkin1, user.timezone=America/Los_Angeles, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, java.class.path=C:/eclipse/plugins/org.eclipse.jdt.junit_3.0.0/junitsupport.jar;C:/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.0.0/junitruntime.jar;D:\devel\test\hibernateBug;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\cglib-asm.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\classes12-9.2.0.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-beanutils.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-collections.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-dbcp.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-lang.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-logging.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\commons-pool.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\datatags-9.0.3.10.35.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\dom4j.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\jdbc2_0-stdext.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\jstl.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\nls_charset12-9.2.0.2.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\odmg.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\standard.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\struts.jar;c:\eclipse\workspace\ACISTest\web\WEB-INF\lib\taglibs-log.jar;C:\eclipse\plugins\org.junit_3.8.1\junit.jar;C:\maven-1.0-beta-7\repository\log4j\jars\log4j-1.2.8.jar;D:\devel\lib\hibernate-2.1\lib\jgroups.jar;D:\devel\lib\hibernate-2.1\lib\jta.jar;D:\devel\lib\hibernate-2.1\hibernate2.jar, user.name=bodkin1, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.show_sql=false, java.vm.specification.version=1.0, java.home=c:\j2sdk1.4.1_03\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.connection.url=jdbc:oracle:thin:@bodkin1-pc.llnl.gov:1521:bodkin1, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, hibernate.jdbc.use_streams_for_binary=true, java.version=1.4.1_03, java.ext.dirs=c:\j2sdk1.4.1_03\jre\lib\ext, sun.boot.class.path=c:\j2sdk1.4.1_03\jre\lib\endorsed\xalan-2.3.1.jar;c:\j2sdk1.4.1_03\jre\lib\endorsed\xercesImpl-2.0.0.jar;c:\j2sdk1.4.1_03\jre\lib\endorsed\xml-apis.jar;c:\j2sdk1.4.1_03\jre\lib\rt.jar;c:\j2sdk1.4.1_03\jre\lib\i18n.jar;c:\j2sdk1.4.1_03\jre\lib\sunrsasign.jar;c:\j2sdk1.4.1_03\jre\lib\jsse.jar;c:\j2sdk1.4.1_03\jre\lib\jce.jar;c:\j2sdk1.4.1_03\jre\lib\charsets.jar;c:\j2sdk1.4.1_03\jre\classes, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_size=0, file.separator=\, hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.statement_cache.size=25, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.cpu.isalist=pentium i486 i386}
2003-11-03 15:03:21,025 INFO ReflectHelper.getMetaClass - reflection optimizer disabled for: Manager, IllegalArgumentException: setManager
2003-11-03 15:03:21,025 INFO ReflectHelper.getMetaClass - reflection optimizer disabled for: Manager, IllegalArgumentException: setManager
2003-11-03 15:03:21,057 INFO ReflectHelper.getMetaClass - reflection optimizer disabled for: Employee, IllegalArgumentException: setManager
2003-11-03 15:03:21,057 INFO ReflectHelper.getMetaClass - reflection optimizer disabled for: Employee, IllegalArgumentException: setManager
2003-11-03 15:03:21,260 DEBUG SessionFactoryObjectFactory.<clinit> - initializing class SessionFactoryObjectFactory
2003-11-03 15:03:21,260 DEBUG SessionFactoryObjectFactory.<clinit> - initializing class SessionFactoryObjectFactory
2003-11-03 15:03:22,010 DEBUG SessionFactoryObjectFactory.addInstance - registered: 00f355b5f8a3d60100f8a3d603ac0000 (unnamed)
2003-11-03 15:03:22,010 DEBUG SessionFactoryObjectFactory.addInstance - registered: 00f355b5f8a3d60100f8a3d603ac0000 (unnamed)
2003-11-03 15:03:22,010 INFO SessionFactoryObjectFactory.addInstance - no JNDI name configured
2003-11-03 15:03:22,010 INFO SessionFactoryObjectFactory.addInstance - no JNDI name configured
2003-11-03 15:03:22,088 DEBUG SessionFactoryImpl.<init> - instantiated session factory
2003-11-03 15:03:22,088 DEBUG SessionFactoryImpl.<init> - instantiated session factory
2003-11-03 15:03:22,150 DEBUG SessionImpl.<init> - opened session
2003-11-03 15:03:22,150 DEBUG SessionImpl.<init> - opened session
2003-11-03 15:03:22,166 DEBUG JDBCTransaction.begin - begin
2003-11-03 15:03:22,166 DEBUG JDBCTransaction.begin - begin
2003-11-03 15:03:22,166 DEBUG DriverManagerConnectionProvider.getConnection - total checked-out connections: 0
2003-11-03 15:03:22,166 DEBUG DriverManagerConnectionProvider.getConnection - total checked-out connections: 0
2003-11-03 15:03:22,166 DEBUG DriverManagerConnectionProvider.getConnection - using pooled JDBC connection, pool size: 0
2003-11-03 15:03:22,166 DEBUG DriverManagerConnectionProvider.getConnection - using pooled JDBC connection, pool size: 0
2003-11-03 15:03:22,166 DEBUG IncrementGenerator.getNext - fetching initial value: select max(id) from test_bug
2003-11-03 15:03:22,166 DEBUG IncrementGenerator.getNext - fetching initial value: select max(id) from test_bug
2003-11-03 15:03:22,260 DEBUG IncrementGenerator.getNext - first free id: 3
2003-11-03 15:03:22,260 DEBUG IncrementGenerator.getNext - first free id: 3
2003-11-03 15:03:22,275 DEBUG SessionImpl.doSave - saving [Manager#3]
2003-11-03 15:03:22,275 DEBUG SessionImpl.doSave - saving [Manager#3]
net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:331)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2590)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2597)
at net.sf.hibernate.impl.SessionImpl.isUnsaved(SessionImpl.java:969)
at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences(SessionImpl.java:915)
at net.sf.hibernate.impl.SessionImpl.nullifyTransientReferences(SessionImpl.java:898)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:803)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:682)
at Test.testNewDerived(Test.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171)

_________________
Ron Bodkin
New Aspects of Security


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 4:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You confused Hibernate by providing both getManager() and isManager().

rename the isManager() method.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Tue Nov 04, 2003 4:28 pm 
Newbie

Joined: Mon Nov 03, 2003 1:46 pm
Posts: 2
Thanks for the quick reply. That makes sense.

It would be helpful for Hibernate to provide more checking for valid mappings to catch problems like this; when learning it I find one needs to do a lot of test iterations to get mappings right. This could be with a static checking tool or flagging more problems when loading the configuration.

Ron

_________________
Ron Bodkin
New Aspects of Security


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.