Hi,
I am having a problem adding additonal maps to my hibernate.cfg.xml file. The problem starts when I add another map resource to the file. Initially I just have <mapping resource="test/User_tbl_map.hbm.xml"/> which causes data to be written to the client screen. As soon as I add <mapping resource="test/Artist_tbl_map.hbm.xml"/> nothing is written to the screen. Can anyone shed any light on this issue?
When I check my logs I get the following output:
1. logs
- Hibernate 2.1.1
- hibernate.properties not found
- using CGLIB reflection optimizer
- configuring from resource: /hibernate.cfg.xml
- Configuration resource: /hibernate.cfg.xml
- Mapping resource: test/User_tbl_map.hbm.xml
- Mapping class: test.User -> usertbl
- Mapping resource: test/Artist_tbl_map.hbm.xml
- Mapping class: test.Artist -> artisttbl
- Configured SessionFactory: null
- processing one-to-many association mappings
- processing one-to-one association property references
- processing foreign key constraints
- Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
- Use outer join fetching: true
- C3P0 using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost:5432/beyarecords
- Connection properties: {user=x, password=x}
- No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
- Use scrollable result sets: true
- JDBC 2 max batch size: 15
- echoing all SQL to stdout
- Query language substitutions: {}
- cache provider: net.sf.ehcache.hibernate.Provider
- instantiating and configuring caches
- building session factory
Jan 26, 2004 2:20:31 PM org.apache.jk.server.JkCoyoteHandler action
INFO: RESET
2. hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<!-- Use a Tomcat JNDI datasource -->
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/beyarecords</property>
<property name="connection.username">postgres</property>
<property name="connection.password">postgres</property>
<property name="connection.pool_size">0</property>
<property name="jdbc.use_scrollable_resultset">true</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.min_size">2</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.max_statements">100</property>
<property name="hibernate.statement_cache.size">0</property>
<mapping resource="test/User_tbl_map.hbm.xml"/>
<mapping resource="test/Artist_tbl_map.hbm.xml"/>
</session-factory>
</hibernate-configuration>
3. Artist table schema
CREATE TABLE "artisttbl" (
"artist_id" integer NOT NULL DEFAULT nextval('artist_seq_id'::text),
"artist_name" character varying(10) NOT NULL,
"artist_photo1" character varying(20),
"artist_photo2" character varying(20),
"artist_photo3" character varying(20),
"artist_info" character varying(1000),
CONSTRAINT "artist_key" PRIMARY KEY (artist_id)
) WITH OIDS;
4. Atrtist_tbl_map.hbm.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="test.Artist" table="artisttbl">
<id name="ID" type="integer" column="artist_id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">artist_seq_id</param>
</generator>
</id>
<property name="artist_name" column="artist_name" not-null="true" />
<property name="artist_info" column="artist_info" />
<property name="artist_photo1" column="artist_photo1" />
<property name="artist_photo2" column="artist_photo2" />
<property name="artist_photo3" column="artist_photo3" />
</class>
</hibernate-mapping>
|