Last active
July 1, 2016 11:10
-
-
Save mp911de/ba6b5150a486da42a65f8efecf86f70c to your computer and use it in GitHub Desktop.
Test-Case for https://bugs.eclipse.org/bugs/show_bug.cgi?id=497143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <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/persiste" | |
| version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"> | |
| <persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> | |
| <class>example.SampleWithSharedPK</class> | |
| <class>example.SharedPKEntity</class> | |
| <exclude-unlisted-classes>true</exclude-unlisted-classes> | |
| <properties> | |
| <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/> | |
| <property name="javax.persistence.jdbc.url" value="jdbc:derby:simpleDb;create=true"/> | |
| <property name="javax.persistence.jdbc.user" value="EclipseJPAExample"/> | |
| <property name="javax.persistence.jdbc.password" value="EclipseJPAExample"/> | |
| </properties> | |
| </persistence-unit> | |
| </persistence> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>eclipselink</groupId> | |
| <artifactId>eclipselink</artifactId> | |
| <version>1.0-SNAPSHOT</version> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.apache.derby</groupId> | |
| <artifactId>derby</artifactId> | |
| <version>10.8.2.2</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.derby</groupId> | |
| <artifactId>derbytools</artifactId> | |
| <version>10.8.2.2</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.eclipse.persistence</groupId> | |
| <artifactId>eclipselink</artifactId> | |
| <version>2.6.3</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.eclipse.persistence</groupId> | |
| <artifactId>javax.persistence</artifactId> | |
| <version>2.1.1</version> | |
| </dependency> | |
| </dependencies> | |
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example; | |
| import javax.persistence.EntityManagerFactory; | |
| import javax.persistence.Persistence; | |
| import javax.persistence.metamodel.IdentifiableType; | |
| /** | |
| * @author Mark Paluch | |
| */ | |
| public class TestCase { | |
| public static void main(String[] args) { | |
| EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("persistenceUnit"); | |
| IdentifiableType<SampleWithSharedPK> entity = entityManagerFactory.getMetamodel().entity(SampleWithSharedPK.class); | |
| entity.getId(entity.getIdType().getJavaType()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment