사용자 도구

사이트 도구


java:jpa:persistence.xml

문서의 이전 판입니다!


JPA persistence.xml

  • META-INF 디렉토리 안에 넣는다.
  • 기본 뼈대
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="2.0">
        <persistence-unit name="unitname" transaction-type="RESOURCE_LOCAL">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <exclude-unlisted-classes>true</exclude-unlisted-classes>
            <mapping-file>ormap.xml</mapping-file>
            <class>org.acme.Employee</class>
            <class>org.acme.Person</class>
            <class>org.acme.Address</class>
            <properties>
                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
            </properties>
        </persistence-unit>
    </persistence>
  • exclude-unlisted-classestrue로 하면 <class>xx</class>로 명시한 클래스만 엔티티로 로딩한다. false이면 CLASSPATH에서 자동 탐색한다.
java/jpa/persistence.xml.1386312281.txt.gz · 마지막으로 수정됨: 2013/12/06 15:44 저자 kwon37xi