I have a class and related .hbm.xml that appear to work
great with Hibernate 2.0.3 in Java.
When I feed this to Hibernator 0.9.6 and I say
"Connect" I get no errors (it adds the mapping .hbm.xml
file with no complaints). I looked at the Eclipse log
and there no errors. BUT the 3 buttons "Execute",
"Create Schema", and "Update Schema" do NOT enable. The
Hibernator Log reads:
Ignoring resources in Project output:
/NewAcesServlet/context/WEB-INF/classes
Adding Project Depedents
d:/save/eclipse/workspace/!MiscJars/Hibernate/DeployJars/hibernate2.jar
Adding Project Depedents
d:/save/eclipse/workspace/!MiscJars/Oracle/DeployJars/classes12.jar
Adding Project Depedents
file:/d:/save/eclipse/workspace/Birdhouse/bin/
Adding Project Depedents
file:/d:/save/eclipse/workspace/AuthAppTools/bin/
Adding Project Classpath
file:/d:/save/eclipse/workspace/NewAcesServlet/context/WEB-INF/classes/
Adding Mapping -
d:/save/eclipse/workspace/NewAcesServlet/src/user.hbm.xml
If I change the database connection to something
invalid I do get an error that "Connection refused". So
that isn't it. (Note: this is using the OracleDialect).
If I screw up the .hbm.xml file I get parse errors on
the .hbm.xml file.
The .hbm.xml file looks like:
<?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="fmtnm.aces.entities.User"
table="ACES_PRINCIPALS">
<id name="id" type="integer" unsaved-value="null">
<column name="UNIQUENUM" not-null="true"
sql-type="NUMBER(10)" />
<generator class="increment"/>
</id>
<property name="userId">
<column name="PRINCIPALID" not-null="true"
sql-type="VARCHAR2(50)"/>
</property>
<property name="firstName">
<column name="FNAME" not-null="true"
sql-type="VARCHAR2(50)"/>
</property>
<property name="lastName">
<column name="LNAME" not-null="true"
sql-type="VARCHAR2(50)"/>
</property>
<property name="homeSite">
<column name="HOMESITE" not-null="true"
sql-type="VARCHAR2(50)"/>
</property>
<property name="sortOrder">
<column name="SORTORDER" not-null="true"
sql-type="VARCHAR2(50)"/>
</property>
</class>
</hibernate-mapping>
Previously I used a slightly different (Hibernate 1.x?)
syntax where column attributes existed completely in
the property tag as attributes which gave me different
results: The 3 buttons enabled but when I would perform
a valid query it would appear to execute but the
"Results View" never changed from gray, always stayed
completely gray.
Help!
Kevin
Logged In: YES
user_id=657555
Well, my app is now essentially ready for production,
my .hbm.xml file is stable, my app is stable, and I still cannot
seen to use Hibernator. I create the connection for the
project, it finds the .hbm.xml file no problem. When I say
connect the log states
Ignoring resources in Project
output: /NewAcesServlet/context/WEB-INF/classes
Adding Project Depedents d:/save/eclipse/workspace/!
MiscJars/Hibernate/DeployJars/hibernate2.jar
Adding Project Depedents d:/save/eclipse/workspace/!
MiscJars/Oracle/DeployJars/classes12.jar
Adding Project Depedents
file:/d:/save/eclipse/workspace/Birdhouse/bin/
Adding Project Depedents
file:/d:/save/eclipse/workspace/AuthAppTools/bin/
Adding Project Classpath
file:/d:/save/eclipse/workspace/NewAcesServlet/context/WEB
-INF/classes/
Adding Mapping -
d:/save/eclipse/workspace/NewAcesServlet/src/fmtnm/aces/p
ersistence/maps/aces.hbm.xml
But the execute/create scehma/update schema buttons stay
disabled (grayed out). Any help would be wonderful. My
database is Oracle 8.1.17. My .hbm.xml file looks like
<?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="fmtnm.aces.entities.User"
table="ACES_USERS">
<id name="userId" type="long"
column="USERID" unsaved-value="null">
<generator class="increment"/>
</id>
<property name="userName" type="string">
<column name="USERNAME"/>
</property>
<property name="newUserName"
insert="false" update="false"
formula="USERNAME"
type="string"/>
<property name="firstName" type="string">
<column name="FNAME"/>
</property>
<property name="lastName" type="string">
<column name="LNAME"/>
</property>
<property name="homeSite" type="string">
<column name="HOMESITE"/>
</property>
<property name="sortOrder" type="string">
<column name="SORTORDER"/>
</property>
<bag name="roles" inverse="true"
cascade="all-delete-orphan" order-by="ROLE">
<key column="USERID"/>
<one-to-many
class="fmtnm.aces.entities.Role"/>
</bag>
</class>
<class name="fmtnm.aces.entities.Role"
table="ACES_USERROLES">
<id name="roleId" type="long"
column="ROLEID" unsaved-value="null">
<generator class="increment"/>
</id>
<many-to-one name="user"
class="fmtnm.aces.entities.User" column="USERID"/>
<property name="role" type="string">
<column name="ROLE"/>
</property>
</class>
<class name="fmtnm.aces.entities.Vehicle"
table="ACES_EQUIPMENTLIST">
<id name="equipId" type="long"
column="EQUIPID" unsaved-value="null">
<generator class="increment"/>
</id>
<property name="id" type="string">
<column name="ID"/>
</property>
<property name="newId" insert="false"
update="false"
formula="ID" type="string"/>
<property name="type" type="string">
<column name="TYPE"/>
</property>
<property name="home" type="string">
<column name="HOME"/>
</property>
<property name="site" type="string">
<column name="SITE"/>
</property>
<property name="status" type="string">
<column name="STATUS"/>
</property>
<property name="prevSite" insert="false"
update="false"
formula="SITE" type="string"/>
<property name="prevStatus"
insert="false" update="false"
formula="STATUS"
type="string"/>
<property name="siteUndo" type="string">
<column name="SITE_UNDO"/>
</property>
<property name="statusUndo"
type="string">
<column
name="STATUS_UNDO"/>
</property>
<property name="retired" type="int">
<column name="RETIRED"/>
</property>
<bag name="comments" inverse="true"
cascade="all-delete-orphan" order-by="COMMENTS_DATE
DESC">
<key column="EQUIPID"/>
<one-to-many
class="fmtnm.aces.entities.Comment"/>
</bag>
</class>
<class name="fmtnm.aces.entities.Comment"
table="ACES_ALLCOMMENTS">
<id name="commentId" type="long"
column="COMMENTID" unsaved-value="null">
<generator class="increment"/>
</id>
<many-to-one name="equipment"
class="fmtnm.aces.entities.Vehicle" column="EQUIPID"/>
<many-to-one name="user"
class="fmtnm.aces.entities.User" column="USERID"/>
<property name="comment" type="string">
<column name="COMMENTS"/>
</property>
<property name="date" type="date">
<column
name="COMMENTS_DATE"/>
</property>
</class>
</hibernate-mapping>