Hibernate不会让我使用实体类名来表名

MaD*_*aDa 5 java hibernate

我有一个名为LocationType(BaseEntity是a @MappedSuperclass)的实体:

@Entity
public class LocationType extends BaseEntity
Run Code Online (Sandbox Code Playgroud)

为此实体生成的表名称是location_type.我知道默认的命名策略是这样的.

我无法理解的是为什么我不能强迫Hibernate使用文字名称locationtype.不管我做什么:

@Entity(name = "LocationType")
public class LocationType 
Run Code Online (Sandbox Code Playgroud)

要么

@Entity
@Table(name = "LocationType")
public class LocationType 
Run Code Online (Sandbox Code Playgroud)

要么

@Entity(name = "LocationType")
@Table(name = "LocationType")
public class LocationType 
Run Code Online (Sandbox Code Playgroud)

表名总是最终为location_type.Hibernate只知道更好!

如果我使用任何其他名称

@Entity(name = "wtf")
Run Code Online (Sandbox Code Playgroud)

然后表名也变成wtf了.

这是记录在案的行为?对我来说看起来像个错误.

类似的问题:Hibernate忽略扩展类的@Table(name ="...") - 创建的表名都是小写(但它指的是继承映射).