I have an object called LocationType ( BaseEntity - @MappedSuperclass ):
@Entity public class LocationType extends BaseEntity
The table name generated for this object is location_type . I understand that the default naming strategy works as follows.
I do not understand why I cannot force Hibernate to use the literal name LocationType . No matter what I do:
@Entity(name = "LocationType") public class LocationType
or
@Entity @Table(name = "LocationType") public class LocationType
or
@Entity(name = "LocationType") @Table(name = "LocationType") public class LocationType
the table name always ends with location_type . Hibernate just knows better!
If I use any other name
@Entity(name = "wtf")
then the table name will also be wtf .
Is this documented behavior? Looks like a mistake.
A similar question: Hibernate ignores @Table (name = "...") for extended classes - created table names are all lowercase (this applies to inheritance mapping, though).
source share