我有一个包含小写表名的已恢复MySQL数据库。我的@JPA表名通常是camelCase。当我启动我的tomcat服务器时,Hibernate会自动创建重复的表名。我将从例如开始:
country
在tomcat启动后,我有
country
Country
我已设置lower_case_table_names = 1
/etc/mysql/conf.d/mysql.cnf
中的
@Entity
@Immutable
@Table(name="Country",indexes={
@Index(name="countryURLLabel", columnList="URLLabel"),
@Index(name="country_url",columnList="url")
})
@NamedQueries({
@NamedQuery(name="country.getByCountryCode", query="select c from Country c where c.countryCode = :countryCode")
})
@FetchProfiles({
@FetchProfile(name = FetchProfileName.OFFER_DETAIL, fetchOverrides = {
@FetchProfile.FetchOverride(entity = Country.class, association = "defaultLanguage", mode = FetchMode.JOIN)
})
})
@NaturalIdCache(region=CacheRegion.NATURAL)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE,region=CacheRegion.COUNTRY)
public class Country implements Serializable, GeoLocation, Comparable<Country>, URLLocation{