Beginner |
 |
Joined: Mon Jan 30, 2006 2:28 am Posts: 47 Location: INDIA
|
Hi,
if u use 1 database table. you should have mapping files (.hbm.xml files) and java files
for e.g;
i have userlogin table. it contains username and password. both are string type.
so the hbm file name is userlogin.hbm.xml.(this file name and Database file name same and all the colunm name should be same)
userlogin.hbm.xml file looks like
<hibernate-mapping package="hibernate.loginDB">
<class name="Userlogin" table="userlogin">
<id name="username" column="username" type="string">
<generator class="native"/>
</id>
<property name="password" column="password" type="string" not-null="true" />
</class>
</hibernate-mapping>
So u should create this .hbm file.
and configure this file in hibernate.cfg.xml file
eg.,
<mapping resource="/Userlogin.hbm.xml" />
_________________ A.Edward Durai
"The things which are impossible with men are possible with God."
|
|