2
votes
1answer
27 views

How can I intercept JTA transactions events and get a reference to the current EntityManager associated with the transaction

Long story short: We develop and maintain a library that can be used in other projects using JavaEE7/CDI/JPA. Applications will run under Glassfish-4.0 and use Hibernate's JPA implementation for an ...
2
votes
1answer
254 views

PostgreSQL and JDBC Prepared Statement Caching

I've been reading that some of the newer JDBC Connection Pools (like Tomcat) do not support client side statement pooling. I already read that this is because most JDBC drivers maintain their own ...
2
votes
1answer
405 views

Displaying Mutable PostgreSQL Arrays in the NetBeans Master/Detail Sample Form using JPA 1.0

Some Background I have a game database with a table called Games that has multiple attributes and one called Genres. The Genres attribute is defined as an integer[] in PostgreSQL. For the sake of ...
1
vote
1answer
154 views

Calling (Postgres) function within a JPA repository

I'm trying to call a function that I have defined in my Postgres DB. CREATE OR REPLACE FUNCTION bacon() RETURNS text AS $BODY$ SELECT cast('ingeborg' as text) $BODY$ LANGUAGE sql STABLE; ALTER ...
1
vote
1answer
66 views

JPQL LIKE syntax with Strings

EDIT: I changed the hard coded query to be: query.setParameter("desc", "%unplug //your// server... enjoy the freedom%" ESCAPE '//') and now I am getting an com.sun.jdi.InvocationException ...
1
vote
1answer
355 views

JPA CriteriaBuilder date operations

I'm trying to translate my sql query to JPA Criteria Builder which is used in project which I'm working on and I stuck on date operation (PostgreSQL 9.3), I have a bit in where clause: ...AND ...
1
vote
1answer
144 views

Error in SPRING JPA using eclipse link POSTGRESQL when executing findBy[NAME]In(List<Long> ids)

I got a problem with my SPRING JpaRepository class when trying to use the findByIdIn(List ids), eg i want to pass a list of ids to the native query and expect it to return a list of objects. Maven ...
0
votes
1answer
60 views

how to pass an array parameter using jpa to a postgresql function?

could someone tell me how to pass an array parameter to a postgresql function using EclipseLink (jpa 2.1)? I tried the below but get error: Exception org.postgresql.util.PSQLException: Can't ...
0
votes
1answer
53 views

Spring Boot JPA Database Choice

How can I start a stand-alone Spring Boot JPA application -- not via cli -- with a choice of databases to get data, e.g., localhost:5432/my_db; or 192.168.1.100:5432/our_db, or ...
0
votes
1answer
32 views

Hibernate DST Date mapping issue for timestamps without time zone

I've a problem with storing java.util/sql.Date in PostgreSQL using hibernate: I'm storing dates as timestamp without time zone type. Now, in most cases everything is alright, as I'm mapping it in ...
1
vote
0answers
21 views

Hibernate to Eclipselink, PostgreSQL and UUID

Here's what I had to write to get UUID working as a primary key, with full UUID types (on all ends) in hibernate. Since this relies on some Hibernate specific code, what would I have to do to convert ...
1
vote
0answers
146 views

PostgreSQL and Hibernate JPA not working

I'm trying to use JPA in Wildfly (which uses Hibernate) with PostgreSQL. I turned on hibernate.show_sql so I can execute the same query in PgAdmin III. The query is this one (EDIT: issuemanager_sch is ...
1
vote
0answers
143 views

saving xml datatype using jpa in PostgreSQL

I want to save an xml datatype using jpa in the database(Postgres entity), i have created a converter which read the data from the xml column and create a field from this data . the problem is that ...
1
vote
0answers
49 views

Play or JPA adding unique constraints to my table

I have a one to many relationship between two models in Playframework 2.1.5. Here's the code : @OneToMany(cascade={CascadeType.PERSIST, CascadeType.REMOVE}) public List<OperationInstance> ...
1
vote
0answers
147 views

JPA forming query which fails at program running

I am doing the following query in JPA: @NamedQuery(name = PlayerSkill.DELETE_ALL_BOT_DATA, query = "DELETE FROM PlayerSkill s WHERE s.player.id " + "IN (SELECT ...
1
vote
0answers
54 views

Running Postgres stored procedure from JPA which accept an array as a parameter

I want to run a Postgres stored procedure from the EclipseLink 2.5.1 version which accepts as a parameter an array of UUIDs. I couldn't find any example for such a thing online. Is it possible? ...
1
vote
0answers
278 views

Mapping JSON String as Postgresql's JSON type with hibernate

How should I tell Hibernate to map a String containing a JSON value to PostgreSQL as PostgreSQL's JSON Type ? Assume I have an attribute like this: private String foo_json_value; I have used Gson ...
0
votes
0answers
23 views

How to properly call PostgreSQL functions (stored procedures) within Spring/Hibernate/JPA?

I'm using Spring MVC 4, Hibernate and PostgreSQL 9.3 and have defined function (stored procedure) inside Postgres like this: CREATE OR REPLACE FUNCTION spa.create_tenant(t_name character varying) ...
0
votes
0answers
26 views

Talend, Postgres and sequences

I have a JPA application and associated Postgres schema that was designed with a single sequence table (not a sequence). I am trying to populate several tables using Talend tPostgresqlOutput. These ...
0
votes
0answers
16 views

Using a single sequence table in Postgres

I have an Eclipse Link JPA application that use Postgres as the DBMS. By default, when the application deploys it builds s Sequence table that holds a single row counter. Keys for all tables are ...
0
votes
0answers
21 views

Getting the connection pool password within the running applicaiton

I have an application at which i want to provide backup service to the user without giving him the DB Engine Admin password. The platforms used are: EJB (glassfish). JPA(Eclipse link). DB Engine ...
0
votes
0answers
15 views

how to map a non-entity result set coming from a NameStoredProcedure in JPA 2.1?

I am calling a postgresql procedure using jpa 2.1 and would like to convert the result set to a non-entity class called StoreAndCategoryID containing two integer fields called: storeid, categoryid. ...
0
votes
0answers
12 views

How to map Results when Querying raw SQL using Ebean

Using Postgres Tables created by Ebean, I would like to query these tables with a hand-written statement: SELECT r.name, r.value, p.name as param1, a.name as att1, p2.name ...
0
votes
0answers
39 views

Hibernate 4.3.1 JPA How to start new Thread injecting EntityManager from Action?

It seems my application is leaking database connections, although I'm specifying the following in persistence.xml : <property name="hibernate.connection.release_mode" ...
0
votes
0answers
15 views

Dangling open transaction with JPA

I've got a ws app running with a postgresql (9.3) db using JPA with Hibernate as persistence provider. When I terminate the app I get a 'unexpected EOF on client connection with an open transaction' ...
0
votes
0answers
26 views

Rows are being deleted after fetch on from @ElementCollection

I have created an Entity called Media with a list of tags that relate to the Media. I use @ElementCollection to save the tags. I have annotated it according to this post The problem is when I reading ...
0
votes
0answers
22 views

How to map org.postgresql.geometric.PGpoint to Hibernate Type

I'm migrating my application from spring jdbc to JPA + Hibernate and the DB used is postgres. One of my table in the DB has point data type which translates to org.postgresql.geometric.PGpoint if i ...
0
votes
0answers
21 views

NetBeans - Wizard Entity Classes from Database crates a Join Table for a non-junction table

I have a issue while using the wizard from Netbeans 7.4 (JDK 1.7U5 with JPA2.1) to generated the entity classes from database. I have the next 3 tables in the DB Model: CREATE TABLE CFG_LOCAL_PRODUCT ...
0
votes
0answers
42 views

@Schedule task with timer service and JPA transactions for EJB applications

I'm new EJB application developer. I'm using Glassfish4, EJB3.1 and Postgresql. There's a problem in JTA transaction in my application. The entity object does not update when I use @Schedule method to ...
0
votes
0answers
118 views

Unable to Configure EntityManagerFactory - JPA

I have an application developed in GWT + Errai using Postgres as backend, deployed in jboss7. I have recently migrated the whole application from one Openshift (Origin) instance to another with rhc ...
0
votes
0answers
60 views

Avoid ConstraintViolationException in JPA and OneToMany relationship when merge

What I want to achieve with the example below is to avoid the constraint violation exception that occurs when run the following: Parent p = new Parent(); Set<Child> children = new ...
0
votes
0answers
27 views

JPA NamedQuery without table in database

I have two tables in my database: packet_type and unit. I've created something-like-entity class PacketTypeExt to fetch joined data from both tables. I have simple namedquery: ...
0
votes
0answers
17 views

JPA @ManyToMany when persist it doesn't persist in the join table

I have a @Entity product that has an attribute @ManyToMany(mappedBy = "products", cascade = {CascadeType.PERSIST}) private List<Provider> providers; and another @Entity provider that has ...
0
votes
0answers
41 views

Joda time with EclipseLink and Postgres makes time disappear from DateTime

I have the following Entity: @Entity public class Deal { @Column(nullable = false, insertable = false, columnDefinition = "timestamp default current_timestamp") @Temporal(value = ...
0
votes
0answers
32 views

@JoinColumn with a composite PK

I've searched a lot around internet and I didn't find any solution to my problem. Any help will be so appreciated. I'm using Servicemix 4.5.3 and I have all my dependencies installed (other ...
0
votes
0answers
327 views

Creating PostgreSQL array types like “text[]” using JPA (EclipseLink)

I'm having trouble to create a JPA model class from which EclipseLink would create the following PostgreSQL DDL: CREATE TABLE array_example ( id serial not null, params text[] not null ); As I ...
0
votes
0answers
99 views

Eclipselink/PostgreSQL table creation fails

Recently I was migrating a database from MySQL to PostgreSQL. I use eclipselink for JPA and have Commons dbcp for connection pooling. I have configured my persistence.xml to switch the jdbc driver and ...
0
votes
0answers
22 views

MySQL to PostgreSQL migration and JPA

I do have an assignment of migrating the DB from MySQL to PostgreSQL completely. Since I am using JPA and my DAO layer has the implementation of JPA will I be able to go forward by just changing my ...
0
votes
0answers
20 views

Advice Do's & Don't for JPA + GlassFish 3.1 + PostgreSQL

I am going to work in GlassFish 3.1 with PostgreSQL using JPA, basically I want to know the best practices for the above combination. What is the recommended design pattern? (DAO, DTO, Entity) Is ...
0
votes
0answers
286 views

Can't convert object of type org.postgresql.util.PGobject

I have a problem with using Hibernate Spatial and PostGIS. I have an entity with a field like this: public class LocationBean { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long ...
0
votes
0answers
44 views

@OneToMany in abstract class generates unusable schema

I have the following model classes: @Entity @Inheritance public abstract class BasePage { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; ...
0
votes
0answers
40 views

Different persistence strategies for adding items to lists with Hibernate and EclipseLink using JTA

I'm moving from using EclipseLink with a MySQL server to Hibernate (4.3) with a Postgresql server. Besides some issues, the database switch was straight forward, but I have noticed a difference when I ...
0
votes
0answers
33 views

How to resolve this error : EJB, JSF with Postgresql

I create an application with J2EE, EJB and JSF and I use a PostgreSQL database. when i run the application, i have this error: Exception attempting to inject Remote ejb-ref ...
0
votes
0answers
51 views

Spring jpa: add field to @Entity class. Should this result in the automatic addition of a new column in the underlying table?

I have a class that is an entity using spring jpa. I want to add a new field to this class. A private boolean with getter/setter methods. I have heard that I should be able to just add the field to ...
0
votes
0answers
87 views

Eclipselink: PSQLException: FATAL: password authentication failed for user “usrname”

I'm trying to use JPA in my project to access data from database. I'm using Eclipselink as persistence provider and postgresql as database engine. I wrote a code that performs some CRUD operations on ...
0
votes
0answers
72 views

Do not push instance for duplicate

I am currently trying to use JPA for pushing data to a postgresql database. However, I have issues with duplicate. I have a "Region" table with id, name and country id | name | country ...
0
votes
0answers
93 views

Jpa (hibernate) batch flush

I'm using jpa (hibernate) and I'm trying to make several insert then I'm going to use batch but I have the following problem: Hibernate only makes all insert in the final of process. I'm using jpa ...
0
votes
0answers
51 views

JPQL date operation

I'm trying to write an JPQL using criteria builder to create a predicate which compares date in column to date which is sum of date column and interval stored in other column (postgres 9.3). My SQL ...
0
votes
0answers
66 views

Unable to retrieve timestamp value after saving the record in PostgreSQL

I am saving the record to a PostgreSQL database using JPA. Here the timestamp value is inserted in the DB. But after saving the record I am fetching all the records. The last record which I inserted ...
0
votes
0answers
88 views

How to get JPA unique constraints into postgresql

My application is JPA/Hibernate, and uses H2 for unit tests and PostgreSQL for deployment. I have the following JPA entity: @Entity ...