Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Any help would be greatly appriecated!
Prep: This is a fairly straight forward and common scenario. I have a model to support: An application within an environment on a server has properties and values for those properties such that I have the following tables
Application has keys
app_name
server_name
environment_id
Property has key
property_id
InstanceValues has key
value_id
appPropVal (relation between apps, properties and property values)has keys
app_name
server_name
environment_id
property_id
value_id
The following classes are defined
ApplicationImpl
Property
PropertyValue (contains one value)
AppProperty (contains 1 property and the values assigned)
AppPropValRelationshipKey (contains the composite-id info)
Hibernate version:3.0.5
Mapping documents:
AppProperty:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"hibernate-mapping-3.0.dtd">
<hibernate-mapping schema="j3_foundations_dba" default-lazy="false" package="context">
<class name="AppProperty" table="serv_env_app_prop_val">
<composite-id name="appPropXref" class="AppPropValRelationshipKey">
<key-property name="serverName" column="server_name"/>
<key-property name="environment" column="environment_id"/>
<key-property name="appName" column="app_name"/>
<key-property name="propertyId" column="property_id"/>
<key-property name="propInstId" column="value_id"/>
</composite-id>
<property name="propValIsActiveC" type="character" column="is_active"/>
<property name="replaceDate" type="date" column="replace_date"/>
<property name="effectiveDate" type="date" column="effective_date"/>
<!-- join to the one property which is hooked up to this application -->
<one-to-one name="proper" class="Property" lazy="false"
constrained="false" fetch="select" formula="appPropXref.propertyId"
foreign-key="proper.propertyId">
</one-to-one>
<!-- possible set of values which are hooked to this property which is hooked up to this application -->
</class>
</hibernate-mapping>
Property
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping schema="j3_foundations_dba" package="context">
<class name="Property" table="property">
<id name="propertyId" column="property_id">
<generator class="increment"/>
</id>
<property name="propName" type="string" column="property_name"/>
<property name="propDesc" type="string" column="description"/>
<property name="prefTypeId" type="integer" column="perf_type_id"/>
<property name="propIsActive" type="character" column="is_active"/>
<property name="depricationDate" type="calendar" column="depricate_date"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Hurls on openSession when checking the mapping
Full stack trace of any exception that occurs:Exception msg= Initial SessionFactory creation failed.org.hibernate.MappingException: broken column mapping for: proper.id of: AppProperty
Code:
Partial Stack
org.hibernate.MappingException: broken column mapping for: proper.id of: com.thomson.west.foundations.context.AppProperty
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:121)
at org.hibernate.persister.entity.AbstractPropertyMapping.initIdentifierPropertyPaths(AbstractPropertyMapping.java:162)
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:146)
at org.hibernate.persister.entity.BasicEntityPersister.initOrdinaryPropertyPaths(BasicEntityPersister.java:1395)
at org.hibernate.persister.entity.BasicEntityPersister.initPropertyPaths(BasicEntityPersister.java:1423)
at org.hibernate.persister.entity.BasicEntityPersister.postConstruct(BasicEntityPersister.java:2377)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:375)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at com.thomson.west.foundations.daos.HibernateUtil.<clinit>(HibernateUtil.java:43)
... on into my classes
Name and version of the database you are using:Oracle 10gThe generated SQL (show_sql=true):NoneDebug level Hibernate log excerpt:Code: