Regular |
|
Joined: Wed May 05, 2004 3:41 pm Posts: 118 Location: New Jersey,USA
|
Say I have a class as below:
public class Name{
private Long _lPKId
private String _strFirstName;
private String _strLastName;
//getters and setters
}
I have a hibernate mapping as below:
<class name="Name" table ="employee_name">
<id column="seq_id" name="_lPKId" type="long">
<generator class="sequence">
<param name="sequence">seq_name</param>
</generator>
</id>
<property name="_strFirstName" column="first_name"/>
<property name="_strLastName" column="last_name"/>
</class>
Will this work to persist my object into the DB. I tried a similar example and the following exception was thrown:-
Caused by: java.lang.RuntimeException: Exception building SessionFactory: Could not find a setter for property _lPKId in class Name
How do I have my own naming convention and be able to use Hibernate or am I forced to change my naming conventions for fields.
Thanks,
anand
|
|