Questions tagged [jpa-2.1]

This tag is for questions specifically about new features of version 2.1 of the Java Persistence API.

The Java Persistence API version 2.1 improves JPA 2.0 with features like bulk operations, stored procedure support and new JPQL keywords.

Main features included in JPA 2.1 is:

  • Converters - allowing custom code conversions between database and object types.
  • Criteria Update/Delete - allows bulk updates and deletes through the Criteria API.
  • Stored Procedures - allows queries to be defined for database stored procedures.
  • Schema Generation
  • Entity Graphs - allow partial or specified fetching or merging of objects.
  • JPQL/Criteria enhancements - arithmetic sub-queries, generic database functions, join ON clause, TREAT option.
659 questions
0
votes
1 answer

PropertyAccessException when serializing bean with lazily loaded (bytecode instrumentation) one-to-one relationship

I work on a WildFly web project with JPA/Hibernate. During my time developing this software, I've come to hate Hibernate with a burning passion, as many others apparently did. I wish I didn't use it in the first place, but the project is too far…
Nikša Baldun
  • 1,854
  • 4
  • 28
  • 39
0
votes
0 answers

JPQL Member condition equivalent in Criteria API?

I have a very useful query in JPQL: select count(p) from Project p, in (p.members) s where s.members.email = :email or again select p from Project p, in (p.members) s where s.members.email = :email order by p.lastUpdate desc It is fast, easy to…
le-doude
  • 3,345
  • 2
  • 25
  • 55
0
votes
2 answers

Row not updating - Update button within dialog (opened by button within dataTable)

Versions: PrimeFaces 3.5, JPA 2.1, GlassFish 4.0, Java EE 7, JSF 2.0. Dialog normally opens and displays data for edition, but the "Update" button in this dialog is not working. Button code follows:
Rasshu
  • 1,764
  • 6
  • 22
  • 53
0
votes
2 answers

Log table using JPA 2.1, EclipseLink, JSF 2.0

I already made triggers to log the actions before persisting, updating and deleting the mapped entities, but it's only within MySQL, so I think I must do an "application-level trigger" using annotations @PostPersist, @PostUpdate and @PostDelete. So,…
Rasshu
  • 1,764
  • 6
  • 22
  • 53
0
votes
1 answer

WildFly8 JPA2.1 and Enumerated values

I am having problems with enumerated types with JPA2.1 (included in WildFly8). Here is the class using the set of enums: @Entity @Table(name = "ZOO") public class Zoo extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) …
drodil
  • 2,292
  • 1
  • 22
  • 37
0
votes
1 answer

Can JPA used with EE 5 servers

Can JPA 2.1 be used in EE 5 servers? I want to benefit the option of calling stored procedure capability. Iknow JPA can be used in a stand alone but i woder if this will has any affect on transactions management when used as a managed entity manager…
user2770375
0
votes
1 answer

Calculated Collection Mapping

Is it possible with Eclipselink (or even better with standard JPA 2.x) to use JPQL or SQL to define a calculated collection mapping? We have the following tables: story substory (foreign key to story) substory_x_company (foreign key to substory and…
Thilo
  • 3
  • 2
0
votes
1 answer

JPA 2 one to many - how does JPA infer column information?

I have a JPA2 (Hibernate) application which uses a MySQL database with only two tables. One table is called "companies" and the other table is called "employees". Between the two tables there is a one-to-many ralationship (1 company has many…
AlexLiesenfeld
  • 2,872
  • 7
  • 36
  • 57
0
votes
1 answer

Using new JPA on conditions for one to many mappings

JPA 2.1 has been released recently and a new feature seems to be on conditions. I found it mentioned in some blogs and the Eclipselink documentation. How can I make use of this? I have two entities linked to each other with @OneToMany and…
Udo Held
  • 12,314
  • 11
  • 67
  • 93
-1
votes
1 answer

Create JPA compatible query

I have this table which I would like to store a chain of records. CREATE TABLE table_name ( id INT, unique_id varchar, reference_id varchar, ); I want to implement SQL query for MariDB which prints all records by id with all records…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
-1
votes
2 answers

Dynamic query in stored procedure with a Date parameter in MySQL

I am writing a stored procedure in MySQL with a dynamic query as shown below: DROP PROCEDURE IF EXISTS test; DELIMITER // CREATE PROCEDURE test( IN STATUS VARCHAR(20), IN CREATED_ON1 VARCHAR(10) ) BEGIN SET @query="SELECT STATUS, COUNT(*) FROM…
cdaiga
  • 4,861
  • 3
  • 22
  • 42
-1
votes
1 answer
-3
votes
1 answer

java.lang.NullPointerException while deploying Java EE on Glassfish 4.1.1

I'm working on a java ee web application. Everything was working fine until i use JPA in my EJB. I have been searching whole day but i got no where. here is my EJB Stateless(name = "SignupEJB") public class SignupBean { @PersistenceContext…
user5459652
-3
votes
1 answer

EclipseLink - Not creating relationship

I don't know why relationships is not been created in my database. I have 7 relationships in a table wherein 5 relations works fine, but 2(materialServico,unidadeMedida) won't appears in database(looking at CONSTRAINT REFERENCES) and nothing appear…
1 2 3
43
44