开发者

Set schema name for specific table mappings using JPA

We are using JPA (hibernate) and have certain tables in a specific schema. I know schema names can be set in the ORM mapping file 开发者_运维问答for a given persistence unit but we have a need to set the schema name for only certain object mappings. So the question is: is there a way in JPA to set the schema name for specific object mappings and not for all object mappings, using a single persistence unit?


To map an entity with the table & some specific schema, you can use attributes name & schema of the table annotaion.

@Entity
    @Table(name="PERSON", schema="RECORDS")
    public class Person { ... }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜