> in hibernate
> (http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html)
[quoted text clipped - 9 lines]
> private String title;
> private Date date;
What is the primary key for the database table, then? You'll need some
kind of primary key for any table that is mapped as a Hibernate entity.
You will also need a field in the corresponding class, which will
contain that database attribute.
The names don't matter, if that's what you're asking. In the mapping
file, you can specify the name of the field and the name of the database
attribute, and they do not need to match.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
gk - 07 Oct 2005 01:50 GMT
so,that means , if i have 5 columns in the DB . then class should have
5 member variable . no less no more . correct ?
in fact , i was asking whether this "id" has to be added as a
additional thing apart from the DB columns.
but as you told , there is no additional member variable . all
represents the DB column. so it is fine.
Thank you
Adam Maass - 07 Oct 2005 03:57 GMT
> so,that means , if i have 5 columns in the DB . then class should have
> 5 member variable . no less no more . correct ?
No, not exactly. For the simpler cases, this is generally true. But you
could have multiple columns in the database, represented by a single object
in memory: columns STREET, CITY, ZIP might map to a single class Address.
Likewise, you might not bother to map some of the columns; maybe you don't
need them in memory for what you want to do.