Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的课:
@Entity (name = "Client") public abstract class MyClient { private Map<String, String> _properties; }
Hiberate 将我的属性对象映射到名为“MyClient_properties”的类中。 如何修改它以便将其映射到“Client_properties”? 谢谢
有趣的是,我认为这应该是默认设置。可以肯定的是,@Entity#name如果提供了默认命名功能,则应该采用该值而不是类名。
@Entity#name
无论如何,要明确命名您将使用(奇怪的是)JPA@CollectionTable注释的集合表:
@CollectionTable
@CollectionTable( name="Client_properties" ) private Map<String, String> _properties;