Is it possible to do a cascade save in Section.class? I create Section object and add new questions without id. When I try save it I get error: org.postgresql.util.PSQLException: ERROR: insert or update on table "question_to_section" violates fo
I am trying to use onetomany mapping for product specifications where I copied similar working code from descriptions. I am providing all my code. Caused by: javax.persistence.PersistenceException: [PersistenceUnit: sm-unit] Unable to build EntityMan
i have the following meetings table package ng.telecomroadmap.model; import java.io.Serializable; import javax.persistence.*; import java.util.Date; import java.util.List; /** * The persistent class for the meetings database table. * */ @Entity @Tabl
Here I read that length in @column is only for generated DDL. Is this true for precision and scale? @Column(precision = 15, scale = 5) private Integer myField; If so: How to define precision and scale for JPA-validation?The JPA javadocs and spec (lin
hibernate dirty flag works great for what they call "persistent" objects https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/objectstate.html but i have a web app, where the hib mang entity Order is also used as the Spring MVC command obj
I have the jsp page with html form which has two textfields for a name, year of birth and a search button, for searching a user/s. A user has the option to search by entering both name and year of birth or by name or by year of birth, which means he
I'm in trouble with JPA2 criteria API. Is there any approach to make smth like this with JPA2 criteria API: SELECT t1.id FROM Table1 t1 INNER JOIN Table2 t2 ON (t1.id = t2.id) With these rules: table1 hasn't table2 reference table2 has table1 referen
I try to build this jpa project but running into the same error. I updated, changed everything still nothing. What am I missing? I only use EclipseLink (JPA 2.0) in the libaries. NetBeans IDE 7.2. An annotation processor threw an uncaught exception.
public static UserDetail UserDetail.findUserDetail(Long id) { if (id == null) return null; return entityManager().find(UserDetail.class, id); } We are using spring Roo. Above is Roo generated finder method. Partial stack trace is as follows: Caused b
I am storing values like names,password,username,email in database and i want that an id a primary column automatically created and it's value start with 1 and automatically increment . I am creating one class user and it has data member like i write
I would like to know how to generate static metamodels using Maven and Eclipselink 2.5. It worked fine by adding this lines to pom.xml when running Eclipselink 2.4. // Generate meta model for eclipselink 2.4 (does not work for 2.5) <plugin> <grou
Is it posible to create a criteria for generating below sql: select name from (select distinct name from person) as aliasname order by lower(name); here there are two sql - select distinct name from person select name from <output of 1> as aliasname
I'm trying to persist data with Play 2 using JPA, but i'm getting: Execution exception [IllegalArgumentException: Unknown entity: models.Stream]; Stream.java ` package models; import javax.persistence.Entity; import javax.persistence.EntityManager; i
This question already has an answer here: Can't create a EntityManager in JavaFx 1 answer I tried to use EntityManager in a JavaFx application in NetBeans (my solution is connected to postgres), I proceeded as follows : 1) I created a Persistence Uni
I'm now using the JPA2 @Cacheable annotation on my Entities, and all is working well. I now need to cache a ManyToOne association. In classic Hibernate, it was necessary to annotate the association with @Cache. @org.hibernate.annotations.Cache(usage=
I have two tables that I would like to treat as a single model class in Hibernate/Spring, however their only relationship can be established through a third table. For example... tableA { id integer <PK> username varchar2(25 byte) } tableB { personI
I have an existing eclipse project (JAVA application), now I created a table in xampp - phpMyAdmin. In the project I need to implement all the queries and database in two ways: 1) JDBC 2) JPA and to choose one of them using the Spring mechanism. So I
mI've this entity class: @Entity public class User implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; @ManyToOne private User myFriend; @OneToMany(mappedBy="friend") private Collection<User> friend
There are many questions about this PersistenceException, but I have not seen some, where the specific line of code throws this exception only sometimes (but not randomly:-). So, do you have any idea, why once my simple app finds the provider ok, but
I have an issue using CascadeType.Persist for my JPA/Standalone project. I have a Parent entity which has a List of Child entities that should be persisted along with the Parent and the primary key of Parent is generated using the Table(GeneratorType
Is there any way to limit the list's size of the @OneToMany relationship in JPA? Here's my code sample: @OneToMany(mappedBy = "publication", cascade=CascadeType.PERSIST) private List<Comment> commentList; I'm using EclipseLink 2.3 JPA impl
I'm using Hibernate and have a problem with LazyInitializationException in my app. This problem can be simply solved by Spring framework(some annotations,config or something) but I just dont know this framework and dont want to learn it now(I'm just
Let's say we have two entities, A and B. B has a many-to-one relationship to A like follows: @Entity public class A { @OneToMany(mappedBy="a_id") private List<B> children; } @Entity public class B { private String data; } Now, I want to de
I'm trying to remove a parent, but I keep getting a Foreign Key violation. If I put Cascade.ALL in the parent, it delete the children too. And it's now what I want. I have my parent class : Docteur //bi-directional many-to-one association to Patient
Hallo all. I have this set of classes: @Entity @Table(name = "S_MC_CC_RAPPORTI") @Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="COD_TIPORAPPORTO", discriminatorType=DiscriminatorType.CHAR, length=1) public abs
I want to cleanup the database after every test case without rolling back the transaction. I have tried DBUnit's DatabaseOperation.DELETE_ALL, but it does not work if a deletion violates a foreign key constraint. I know that I can disable foreign key
I need to use an Entity framework with my application, and I have used table - partitions in Oracle database. With simple JDBC, I am able to select data from a specific partition. But I don't know whether I can do the same with hibernate or Eclipse l
I'm trying to integrate Hibernate Search into one of the projects I'm currently working on. The first step in such an endeavour is fairly simply - index all the existing entities with Hibernate Search(which uses Lucene under the hood). Many of the ta
How do you enable debug logging for OpenJPA when running an application in WebLogic 11g? I tried the steps given by Logging JPA SQL with Weblogic 10.3, but no OpenJPA log statements appear in the server log. I have also poured over the WebLogic docum
Is there a way to change the JPA fetch type on a single method without editing the entity object? I have a shared ORM layer consisting of JPA entity classes. This ORM layer is accessed by two DAO layers. One DAO needs lazy fetching, as it is for my w