Hibernate工具在数据库中使用同义词

zDr*_*oid 2 hibernate hibernate-tools

hibernate工具是否能够连接到数据库中的同义词表?我的DBA问我这个问题.

Adr*_*sca 6

是的,只需在persistence.xml中启用属性"hibernate.synonyms"

    <properties>
        <property name="hibernate.synonyms" value="true"/>

    </properties>
Run Code Online (Sandbox Code Playgroud)

并用.注释你的实体类

    @Entity
    @Table(name = "<repalce with synonym name>")
Run Code Online (Sandbox Code Playgroud)