java - How to Map single POJO class to Multiple Tables -


i'm trying map com.chqmas.user.user pojo class both usr table.and usr_pwd_history tables.

<?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>     <class name="com.chqmas.user.user" table="usr" batch-size="50">         <id name="name" column="name"/>         <property name="bankbranch" column="bank_branch"/>         <property name="realname" column="real_name"/>         <property name="pwd" column="pwd"/>         <property name="pwdenc" column="pwd_enc"/>         <property name="level" column="level"/>         <property name="url" column="url"/>         <property name="status" column="status"/>         <property name="lastsignondate" column="last_sign_on_date"/>         <property name="passwdchangeddate" column="pass_wd_change_date"/>     </class>      <class name="com.chqmas.user.user" table="usr_pwd_history" batch-size="50">         <id name="name" column="name"/>         <property name="pwd" column="pwd"/>         <property name="pwdenc" column="pwd_enc"/>         <property name="passwdchangeddate" column="pass_wd_change_date"/>     </class> </hibernate-mapping> 

but got error..

enter image description here

how can map pojo class these 2 tables.

thank you.

usr , usr_pwd_history represent 2 different logical entities, why not keeping list of password history inside user object?


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -