I have a Class whose objects I want to be able to persist via Hibernate such as:
package my.package
@Entity
@Table(name="hibernatedclass")
public class HibernatedClass {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
private Long id;
@Column(name="firstname")
private String firstname;
[....]
}
As it can be seen the name I have given the table to store the objects of my.package.HibernatedClass
is named hibernatedclass
.
What I am looking for in an answer is: How can this naming be automatized? Something that would imho look similar to this pseudo-code.
@Table(name=class.getCanonicalName())