This isn't necessarily a problem as much as it is a concern. I have created a simple many-to-one association between a User table and a User Type table (each user has a required type).
I created the mapping file (shown below) and everything seems to work. What I am concerned about is that the object type of the associated UserTypeDTO (member of UserDTO) shows up in Eclipse as "UserTypeDTO$$EnhancerByCGLIB$$db866832", instead of "UserTypeDTO". Further, the members populated by Hibernate show as null in the debugger, even though if I do gets on the object the members are populated.
I am retrieving my list of UserDTOs using the following query:
List theList = s.createQuery("from UserDTO").list();
Anybody else have this issue? My fear is this is a problem and I will see the effects later on.
Hibernate version:
3.0.5
Mapping documents:
<class name="com.ar.cfo.model.dto.UserDTO" table="test.scrty_user">
<id name="id" column="scrty_user_id" >
<generator class="identity"/>
</id>
<property name="firstName" column="frst_nm"/>
<property name="lastName" column="last_nm"/>
<property name="username" column="scrty_user_nm"/>
<many-to-one name="userType" column="scrty_user_type_id" not-null="true" />
</class>
<class name="com.ar.cfo.model.dto.UserTypeDTO" table="test.scrty_user_type">
<id name="id" column="scrty_user_type_id">
<generator class="identity"/>
</id>
<property name="description" column="scrty_user_type_descr"/>
</class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 5.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html