The Java Persistence API (JPA) is a specification that describes the management of relational data in Java applications.

learn more… | top users | synonyms

1
vote
1answer
33 views

Hibernate entity design with a Currency class

I have a class Currency, where I want to store business logic for working with currencies: ...
4
votes
0answers
80 views

Property Change Listener for Entity Management

I would like to know if the solution I came up with for managing relationships between entities is sensible. Guys in my team feel it is transparent, but maybe I'm missing a pitfall somewhere? ...
6
votes
1answer
109 views

Shortening JPA criteria query boilerplate

I've used hibernate for a long time. Recently I started using JPA, but I can't find a short way to write a simple select in less than these seven lines (the use of criteria is a must in this project). ...
1
vote
1answer
1k views

JavaEE 7 with JPA (Hibernate) and JAX-RS (RestEasy)

below is a working example of code in which you can create car colors and cars using these colors with XML POST messages. And request all cars and colors formatted in XML using a GET message. I am ...
1
vote
1answer
506 views

Simple guestbook made using Java EE 7 technologies (JSF, CDI, EJB, JPA)

I'm making my first steps in Java EE. This is a simple guestbook made using Java EE 7 technologies (JSF, CDI, EJB, JPA). I will really appreciate your feedback. Does the code follows the standard ...
0
votes
1answer
40 views

Facade pattern usage with JDBC-resource on Glassfish

For this project: ...
4
votes
2answers
85 views

Making a database entity superclass

I am using JPA for my database work and I need to create a database entity superclass which all of my table entities will extend. Every database entity will have a primary key named ...
0
votes
1answer
83 views

First facelets with JPA app on glassfish

So far as I've tested it, these few facelets files with JPA database connections work as intended. The queue, MyQueue, is at ...
1
vote
1answer
391 views

JavaSE client: is this how to get a new JPA EntityManager each time? (DAO)

This class functions, in that the program can be left open for hours and it will still reconnect to the database when the user prompts for a CRUD operation. I've read about DAO, and some other ...
3
votes
1answer
803 views

Inserting data in 3 tables of a database with JPA

I am starting a personal project and my first step is to insert a lot of statuses from tweeter in a database along with it's user and place (if applicable). This is the database structure: Pretty ...
6
votes
1answer
63 views

Intern AuditSystem in DB and getting users from it

My project has a change on the database, so that every INSERT-UPDATE-DELETE action is logged with triggers on the DB. For that they have an extra table created: Table ...
3
votes
3answers
8k views

Efficient way of handling multiple sorting and filtering using JPA

I'm using JPA 2.0, Mojarra 2.1.9 and its component library Primefaces 3.5. I have a table in MySQL database named state_table with three columns. state_id ...
1
vote
2answers
135 views

Repetitive code for different Database Entities with same implementation

I have this code in LogInService ...
3
votes
1answer
1k views

JPA connection : is this code is efficient enough

By reading some tutorial i have written some peace of code to do crud operation . I just want to know how is this code is efficient or how can i make better ? Here i am giving code of 3 class 1. ...
5
votes
2answers
967 views

Checking if entity exist in Google App Engine Datastore using JPA 1

Below is my method in checking if entity already exist. ...