Ok, first off, I tried, I really did 

I'm trying to map an object called Data.Code.Employee.Class to its own
table. Here's what I have done so far:

In \xwiki\WEB-INF\ i have a file called EmployeeClass.hbm.xml that has the
following content 



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC 
  &quot;-//Hibernate/Hibernate Mapping DTD//EN&quot; 
  &quot;http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd&quot;>

<hibernate-mapping auto-import="true">
    <class name="Data.Code.Employee.Class" table="xwikiemployeeclass">
        <id name="id" type="long" unsaved-value="undefined">
            <column name="xws_id" not-null="true"/>
            <generator class="assigned"/>
        </id>
        <property name="firstName" type="string" column="xws_firstName"
length="255"/>  
        <property name="middleName" type="string" column="xws_middlename"
length="255"/>  
        <property name="lastName" type="string" column="xws_lastname"
length="255"/>  
        <property name="job" type="integer" column="xws_job"/>  
        <property name="supervisor" type="integer" column="xws_supervisor"/>    
        <property name="SSN" type="integer" column="xws_ssn"/>  
        <property name="DOB" type="timestamp" column="xws_dob"/>        
        <property name="hired" type="timestamp" column="xws_hired"/>    
        <property name="address1" type="string" column="xws_address1"
length="255"/>  
        <property name="address2" type="string" column="xws_address2"
length="255"/>  
        <property name="city" type="string" column="xws_city" length="255"/>    
        <property name="state" type="string" column="xws_state"
length="255"/>  
        <property name="zip" type="string" column="xws_zip" length="255"/>      
        <property name="phone1" type="string" column="xws_phone1"
length="255"/>  
        <property name="phone2" type="string" column="xws_phone2"
length="255"/>  
    </class>
</hibernate-mapping>


Then in the hibernate.cfg.xml file I added a mapping resource to the MySQL
section like this:


    <property name="connection.url">jdbc:mysql://localhost/xwiki</property>
    <property name="connection.username">xwiki</property>
    <property name="connection.password">xwiki</property>
    <property
name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property
name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
    <property name="dbcp.poolPreparedStatements">true</property>
    <property name="dbcp.maxOpenPreparedStatements">20</property>
    <mapping resource="xwiki.hbm.xml"/>
    <mapping resource="feeds.hbm.xml"/>
    <mapping resource="activitystream.hbm.xml"/>
    <mapping resource="instance.hbm.xml"/>
    <mapping resource="mailsender.hbm.xml"/>
    <mapping resource="EmployeeClass.hbm.xml"/>

I also enabled custom mapping by setting
xwiki.store.hibernate.custommapping=1 in xwiki.cfg

I created the xwikiemployeeclass table in MySQL manually and it made no
difference.

So here is what happens: if  I add the mapping resource to the hibernate
file, xwiki freezes at about 50% loading. If I remove that line everything
is fine. I'm fresh out of ideas.

HELP!!

Dan

PS.: none of those other xml files mentioned in the MySQL section seem to be
anywhere. Can't find them. Where are they? (like the instance.hbm.xml file
for example)



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Custom-Mapping-tp7599790.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to