|
Hello,
I am in the midst of porting a project from Glassfish to Wildfly 8.1. This is a maven-project.
This is my environment:
$ mvn -ver mvn Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.7.0_75, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.13.0-45-generic", arch: "amd64", family: "unix"
I am using eclipselink as the JPA-implmentation. Tested the connection, saved and retrieved an entity from the database - so that is working. This is a snippet from my pom.xml
<dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> <version>2.5.2</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId> <version>2.5.2</version> <scope>provided</scope> </dependency>
And my JBOSS_SERVER holds : wildfly-8.1.0.Final/modules/system/layers/base/org/eclipse/persistence/main 1. eclipselink-2.5.2.jar 2. jipijapa-eclipselink-1.0.1.Final.jar 3. module.xml
Here is my super-class:
@Entity @Table(name = "MEDIA") @NamedQueries(
Unknown macro: { @NamedQuery(name = "Media.FindByUuid", query = "SELECT c FROM Media c where c.uuid = }
) @Inheritance(strategy = InheritanceType.JOINED) public abstract class Media implements Serializable {
and here is my child-class:
@Entity @Table(name = "IMAGE") @NamedQueries(
Unknown macro: { @NamedQuery(name = Image.FIND_ALL, query = "SELECT i FROM Image i") }
) @XmlRootElement public class Image extends Media implements Serializable {
The following is not working and giving me 'null' in Wildfly, but working in Glassfish.
Query query = em.createNamedQuery("Media.FindByUuid"); // hardcoding the UUID, which I have in my database : query.setParameter("uuid", "000d8f7c-6c7b-4c56-9799-ac67666462b5"); T media = (T) query.getSingleResult();
Not understanding the advises given in this thread. Could you help me to narrow my troubleshooting ? am I doing something wrong or ... Should I upgrade eclipselink ? Should I go for Wildfly 8.2 ? Should I change Inheritance-strategy ?
|