0

Hibernate Table-Per-Subclass (not related to ZK question)

asked 2009-05-15 14:06:31 +0800

bob007 gravatar image bob007
384 3 4

updated 2009-05-15 16:23:17 +0800

*** SOLVED ***

Hi,

I know my question is not related to ZK but since the hibernate seem to be down again...

I asking myself if the subclass need to be in the same package than the super class when using Table-Per-Subclass mapping like this ?

Thank you for help,

<hibernate-mapping>
   <class name="com.javalobby.tnt.hib.User" table="USER" lazy="false">
      <id name="id" type="long" column="ID">
         <generator class="identity" />
      </id>

      <discriminator column="type" type="string"/>
      
      <property name="firstName" column="first_name"/>
      <property name="lastName" column="last_name"/>
      
      <subclass name="com.javalobby.tnt.hib.Employee" discriminator-value="employee">
         <join table="employee">
            <key column="id"/>
            <property name="jobTitle" column="job_title"/>
            <many-to-one name="supervisor" column="supervisor_id" not-null="true" />
         </join>
      </subclass>
   </class>
</hibernate-mapping>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-05-15 16:24:08 +0800

bob007 gravatar image bob007
384 3 4

Ok its solved, the answer is no we didnt need to put it in the same package

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-05-15 14:06:31 +0800

Seen: 122 times

Last updated: May 15 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More