Below is my mapping and my code, and the output below that. I don't get any output from the "I didn't get here" ... it doesn't get there. and that's bad.
Any ideas?
Steve
<?xml version="1.0" ?>
<!DOCTYPE hibernate-mapping (View Source for full doctype...)>
- <hibernate-mapping default-cascade="none" auto-import="true">
- <class name="com.cti.portal.drugorder.PortalDrugItem" table="PRTL_DRUGS" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" batch-size="1" select-before-update="false" optimistic-lock="version">
- <composite-id unsaved-value="none">
<key-property name="drugCode" column="DRUG_CODE" />
<key-property name="drugName" column="DRUG_NAME" />
</composite-id>
</class>
</hibernate-mapping>
try {
sess = sessions.openSession(); // obtain a JDBC connection and
// instantiate a new Session
Query q = sess.createQuery(
"from PortalDrugItem as di"
);
System.out.println("I got here");
List result = null;
System.out.println("I got here");
result = q.list();
System.out.println("I didn't get here");
System.out.println(result.size());
ArrayList list = new ArrayList();
Iterator iter = result.iterator();
int i = 0;
while ( iter.hasNext() ) {
System.out.println("Hi");
Object o2 = iter.next();
System.out.println(++i);
if (o2 == null) {
System.out.println("Null o2");
} else {
PortalDrugItem foo = (PortalDrugItem) o2;
System.out.println(foo.getDrugName());
}
}
}
finally {
sess.close();
}
INFO: Starting Coyote HTTP/1.1 on port 8080
Oct 22, 2003 11:09:04 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Oct 22, 2003 11:09:04 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=30/61 config=C:\www\Tomcat 5.0\bin\..\conf\jk2.properties
Oct 22, 2003 11:09:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 24275 ms
Oct 22, 2003 11:09:20 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.2
Oct 22, 2003 11:09:20 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.
Oct 22, 2003 11:09:20 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Oct 22, 2003 11:09:20 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
Oct 22, 2003 11:09:20 AM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/cti/portal/drugorder/PortalDrugItem.hbm.xml
Oct 22, 2003 11:09:22 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.cti.portal.drugorder.PortalDrugItem -> PRTL_DRUGS
Oct 22, 2003 11:09:23 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Oct 22, 2003 11:09:23 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Oct 22, 2003 11:09:23 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Oct 22, 2003 11:09:24 AM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.OracleDialect
Oct 22, 2003 11:09:24 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
Oct 22, 2003 11:09:24 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@knoxoatest:1525:prtldev
Oct 22, 2003 11:09:24 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=portal4, password=portal4}
Oct 22, 2003 11:09:24 AM net.sf.hibernate.ps.PreparedStatementCache <init>
INFO: prepared statement cache size: 10
Oct 22, 2003 11:09:24 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use outer join fetching: true
Oct 22, 2003 11:09:26 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use scrollable result sets: true
Oct 22, 2003 11:09:26 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: JDBC 2 max batch size: 15
Oct 22, 2003 11:09:26 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: echoing all SQL to stdout
Oct 22, 2003 11:09:27 AM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JDNI name configured
Oct 22, 2003 11:09:27 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Query language substitutions: {}
I got here
I got here
Hibernate: select portaldr0_.DRUG_CODE as DRUG_CODE, portaldr0_.DRUG_NAME as DRUG_NAME from PRTL_DRUGS portaldr0_
|