hibernate-annotations Questions

4

Solved

Is there a setting in hibernate to ignore null values of properties when saving a hibernate object? NOTE In my case I am de-serializing JSON to a Hibernate Pojo via Jackson. The JSON only conta...
Rhumb asked 22/9, 2011 at 15:41

6

Solved

Can someone please explain to me @MapsId in hibernate? I'm having a hard time understanding it. It would be great if one could explain it with an example and in what kind of use cases is it most a...
Dictate asked 29/3, 2012 at 10:34

3

Solved

I have some annotation in a class such as public class ProductModel { @Pattern(regexp="^(1|[1-9][0-9]*)$", message ="Quantity it should be number and greater than zero") private String quantity; ...

5

Solved

When they appear on a field/getter of an @Entity, what is the difference between them? (I persist the Entity through Hibernate). What framework and/or specification each one of them belongs to? @N...
Oxalate asked 16/9, 2011 at 2:20

15

Solved

Why am I getting this exception? package com.domain.idea; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinC...
Debbi asked 7/12, 2010 at 20:33

3

Solved

Will this work - @OneToOne() @JoinColumn(name = "id", referencedColumnName = "type_id") @Where(clause = "type_name = OBJECTIVE") public NoteEntity getObjectiveNote() { return objectiveNote; } T...
Incontrollable asked 8/12, 2010 at 0:20

4

How do I disable lazy loading in Hibernate? I am using persistence annotations, not an hbm xml file. I am fetching a single object by ID and want all properties loaded. The session is closed befo...
Nationwide asked 29/3, 2011 at 21:25

2

I have a table with a column that has a UNIQUE constraint. I want the constraint checking to be deferred to commit time. If I create it using Postgres SQL like this (many columns omitted): CREAT...
Magnien asked 15/11, 2017 at 21:38

3

Solved

I am trying one to one relationships using annotations. This is the code. package test.hibernate; @Entity @Table(name="EMPLOYEE") public class Employee { @Id @GeneratedValue @Column(name="EMP...
Lindsley asked 24/8, 2013 at 12:49

3

Solved

I am using hbm2ddl in my hibernate based application to generate the db schema. The value of hibernate.hbm2ddl.auto property is create-drop. I am using @Entity annotations for my POJO classes. ...
Jaquelynjaquenetta asked 29/7, 2011 at 19:30

3

Solved

I am having an issue in setting up a one to many relationship in my annotated object. I have the following: @MappedSuperclass public abstract class MappedModel { @Id @GeneratedValue(strategy=Ge...
Doily asked 25/10, 2010 at 2:14

5

Solved

In the class Parent there is a list List. When the parent is saved the children which have been added or changed shall be save / updated by hibernate. I've found many explanations on this, however...
Ayers asked 10/3, 2012 at 21:48

9

Solved

I have a database view that yields a result set that has no true primary key. I want to use Hibernate/Persistence to map this result set onto Java objects. Of course, because there is no PK, I cann...
Copenhaver asked 29/5, 2009 at 12:54

4

In my web application, I have a text area whose user-filled contents are ultimately persisted to the db with Hibernate. I have been running into an issue that when the user input is beyond a certai...
Fao asked 21/1, 2010 at 20:35

2

Solved

I am trying to disable the foreign key constraint being generated on my bidirectional association. I have managed to do this for all my unidirectional associations, but for some reason it is not wo...
Cosmogony asked 18/1, 2017 at 21:24

2

Solved

I'm trying to get Hibernate @OneToOne annotations working and not having much success here... Let's say I've got a table called status that looks like this: +---------------------------------------...
Blanco asked 13/2, 2014 at 18:17

5

Solved

I have one entity - User. It is described by User.class. Hibernate creates one table per entity, so when I call session.save(user), my data is always saved to this table. Now I need another table...
Strumpet asked 26/5, 2013 at 0:54

7

Solved

I am new to hibernate. What I am trying to do is use @CollectionIdto generate an identifier for my Address class. I have used Collection interface for this. However when I use @GenericGenerator and...
Freudberg asked 13/10, 2015 at 12:58

3

Solved

I am trying to use Hibernate annotation for writing a model class for my database tables. I have two tables, each having a primary key User and Question. @Entity @Table(name="USER") public class ...
Verlie asked 15/3, 2013 at 7:14

2

Solved

This is my annotation class and i want userId and groupId column both as primary key. I have found more questions (Question) about this, but didn't found relevant answer. I have less reputation, so...
Marnamarne asked 22/1, 2014 at 13:25

3

Solved

Another Hibernate question... :P Using Hibernate's Annotations framework, I have a User entity. Each User can have a collection of friends: a Collection of other Users. However, I have not been ab...

1

Solved

We just upgraded our JBoss from 6.1.0 to Wildfly 10.1, and made a variety of associated upgrades to modules and artifact versions and so on. In one module this caused our cobertura compiles to fail...

1

Solved

I want to ask how to audit just a part of a superclass of entity, using hibernate annotations such as @AuditOverride, @Audited or else. Right now, I am using hibernate 5.2.12 version. The annotatio...

3

Solved

When trying to use the @Index annotation from javax.persistence, Eclipse gives me this error. I'm using it right before a java.util.Date field, inside a class annotated with @Entity. Before, I wa...
Embrangle asked 12/7, 2013 at 17:12

4

Solved

I want to use Hibernate annotations to represent a unidirectional one-to-many relationship using a join. I want an added condition on the join so it only happens when a column in the source table (...
Holofernes asked 2/8, 2017 at 21:52

© 2022 - 2024 — McMap. All rights reserved.