Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2
Mapping documents:
JPA Annotations
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
MySQL 5.0
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A
Problems with Session and transaction handling?
No
Read this:
http://hibernate.org/42.html
Assuming the following classes, how can I convert a persisted BasicUser to an AdminUser?
Code:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "user")
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER)
public class User {
//some mapped fields
}
Code:
@Entity
@DiscriminatorValue("1")
public class BasicUser extends User {
//some mapped fields
}
Code:
@Entity
@DiscriminatorValue("2")
public class AdminUser extends User {
//some mapped fields
}