Questions tagged [eclipselink]

EclipseLink delivers a comprehensive open-source Java persistence solution. EclipseLink focuses on standards (JPA, JAXB, SDO) with advanced features, performance and scalability for enterprise software developers across data sources, formats, and containers.

EclipseLink delivers a comprehensive open-source Java persistence solution. EclipseLink focuses on standards (JPA, JAXB, SDO) with advanced features, performance and scalability for enterprise software developers across data sources, formats, and containers.

5055 questions
2
votes
0 answers

EM can not resolve configured mapping [EclipseLink-197]

I have a problem with resolving entities during entity manager startup. Now it falls with following error: Exception [EclipseLink-197] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException…
akle
  • 21
  • 2
2
votes
1 answer

JPA @Enumerated Error

I have a Entity with a field which I want to be an Enum. @Column(name = "TEMPRATURE_ZONE") @Enumerated(STRING) private TemperatureRegime tempratureZone; The Enum is defined as follows: public enum TemperatureRegime { AMBIENT, CHILL } The…
James
  • 3,597
  • 11
  • 47
  • 57
2
votes
3 answers

Integer.longValue() does throw an Exception if not assigned to Number first

public Long getId() { Some code ... TypedQuery query = entityManager.createQuery(sQuery, Long.class); return query.getSingleResult(); } From this code i get a ClassCastException from Integer to Long. I checked…
kai
  • 6,702
  • 22
  • 38
2
votes
0 answers

JPA metamodel and @Convert on a List attribute

I'm exploring the possibilities of using the JPA metamodel with the Criteria API. I have some entities that have attributes like this: @Column( name = "defaultValue" ) @Convert( converter = StringListToStringConverter.class ) private List
Hein Blöd
  • 1,553
  • 1
  • 18
  • 25
2
votes
2 answers

EclipseLink equivalent of Hibernate @NaturalID

I haven't worked until today with EclipseLink and I don't seem to able to find a @NaturalId. So what is the equivalent of Hibernate's @NaturalId in EclipseLink ? import javax.persistence.CascadeType; import javax.persistence.Embedded; import…
user3719857
  • 1,083
  • 4
  • 16
  • 45
2
votes
0 answers

JPA : Delete object from unidirectional many-to-many relationship

I have a unidirectional relation between two entities and I want to remove property object from join table only. I tried this but it only removes the property object from template and not from database join table. How can I remove it from join…
gabi
  • 1,324
  • 4
  • 22
  • 47
2
votes
0 answers

"Persistence xml file was not found. NO GENERATION will occur!!" error in build.xml

I am receiving the error [javac] Note: The persistence xml file [META-INF/persistence.xml] was not found. NO GENERATION will occur!! Please ensure a persistence xml file is available either from the CLASS_OUTPUT directory [META-INF/persistence.xml]…
Dumpcats
  • 453
  • 5
  • 21
2
votes
4 answers

JPA Unknown entity type Exception

@Entity @Table(name = "persons") public class Person implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Integer id; …
john.p.doe
  • 411
  • 2
  • 10
  • 21
2
votes
1 answer

Injection of EJB in EntityListener via CDI fails (JPA 2.1)

I am trying to inject a @Stateless EJB into my EntityListner. The @PrePresist method of my EntityListener is invoked, but the injected EJB resolves to null so a NullPointerException is thrown. public class MyEntityListener { @Inject …
stg
  • 2,757
  • 2
  • 28
  • 55
2
votes
1 answer

many-to-many relationship with composite key in jpa

I defined a many-to-many relation between two entities with a composite key. The problem is that when I get the join object it is filtered with only one side of the relation and not both side. The picture makes the problem clearer. Here what im…
gabi
  • 1,324
  • 4
  • 22
  • 47
2
votes
1 answer

Merging Detached JPA Entities Ignoring Unmodified Fields

Short version: Is there a way to tell JPA to ignore null properties of a detached entity instance when merging? Long version: I Have the following scenario: Web Application communicates through HTTP REST with Backend. Backend uses JAX-B, JAX-RS,…
Andrés Esguerra
  • 849
  • 5
  • 15
2
votes
3 answers

No [EntityType] was found for the key class [] in the Metamodel - please verify that the [Entity] class was referenced in persistence.xml

java.lang.IllegalArgumentException: No [EntityType] was found for the key class [] in the Metamodel - please verify that the [Entity] class was referenced in persistence.xml using a specific property or a global…
Saa Satyam
  • 71
  • 1
  • 5
2
votes
1 answer

JPA EclispeLink Insert/Persist replaces null list with emptylist

I have two Entities Person and PersonImage: @Entity public class Person { .... @OneToMany(mappedBy = "person", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, orphanRemoval = true, fetch = FetchType.LAZY) private…
Jehan Zeb
  • 155
  • 12
2
votes
1 answer

java RestFull get current user in action thread

I need to get the current user in JPA EntityListener, in a restful webservice. This is my code: Service Web: @POST @Produces({"application/json"}) @Consumes({"application/json"}) public Response create(@HeaderParam("Authorization") String…
2
votes
0 answers

EclipseLink @CascadeOnDelete behavior

I'd like to comment about a situation that happened with me today when I was using EclipseLink-JPA. I'll show what was the context and how I solved my issue, but I confess I do not understood what happened. Consider the following mapping: class A { …