Tagged Questions
0
votes
0answers
20 views
Is it possible to do this kind of mapping?
Supposed I have one-to-many relation between 2 tables.
Is it possible to do this kind of mapping between them:
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = ...
0
votes
1answer
17 views
Hibernate Mapping Parent/Child Relationship
I have a database table which contains a simple self parent/child relationship (categories) like this:
+------------+----------+--------------------+
| categoryid | parentid | category_name |
...
2
votes
1answer
57 views
Hibernate & Java - mapping similar cols
How would I map elegantly a table that has let's say 15 similar columns like:
NOTE1_TXT VARCHAR2(80)
NOTE2_TXT VARCHAR2(80)
NOTE3_TXT VARCHAR2(80)
etc
NOTE15_TXT VARCHAR2(80)
...
0
votes
2answers
22 views
Hibenate fail to create foriegn key
I have three class with onetomany and manytoone annotated. Below
Category.java
@Entity
public class Category implements Serializable {
@Id
@GeneratedValue
int id;
String cat;
...
0
votes
0answers
36 views
org.hibernate.exception.GenericJDBCException: could not load an entity
During the run time of my code it throws the exception-
org.hibernate.exception.GenericJDBCException: could not load an entity: [com.expo.esf.model.InvoiceHouse#15566]
2013-05-27 15:41:12,852 WARN ...
0
votes
1answer
45 views
HibernateException: Illegal attempt to associate a collection with two open sessions on calling session.update()
I have a table which is associated with so many other tables either with one to one or one to many relationships. while updating (session.update(Parent_Table)) these tables, getting following ...
0
votes
0answers
69 views
Hibernate: Cannot add or update a child row: a foreign key constraint fails
I tried inserting values in Mysql DB ,via hibernate
Hibernate: insert into EMPLOYEEM (FIRSTNAME, LASTNAME) values (?, ?)
Hibernate: insert into MEETING (MEETING_DATE, SUBJECT) values (?, ?)
...
0
votes
1answer
45 views
Hibernate: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
First of all sorry. I know it's have been alot of same topics, but maybe my english bad or maybe I did not find the right answer.
I use Optimistic locking @Version annotation. I need one for one Row ...
0
votes
0answers
40 views
When doing Hibernate session.update() for the parent object, duplicate entries inserted in child with mapped column as null
I have two tables with one to many relationship. When I save a new parent object with two children using hibernate session.save(), it is saving correctly.
But if I do a session.update() for the parent ...
1
vote
1answer
25 views
How to specify a field, so that when we query, using Joda LocalDate or LocalDateTime value for the field, it is mapped to same column?
I have a postgres database that has a table "draft" containing a column set_up_time, saved as a timestamp:
@Column(nullable = false)
@Type(type = ...
0
votes
1answer
15 views
hibernate mapping confusion
Could someone explain me why this doesn't work? I want to have a table that contains informations about two users who played with each other. This doesn't work.
Public class History implements ...
0
votes
3answers
80 views
Hibernate, error org.hibernate.util.JDBCExceptionReporter Field 'Variable_ID' doesn't have a default value
I have problem with insert data from one side relationships to other tables and to other side of relationships at the same time
I have:
Table User with User Entity
@Entity
@Column(name="USER")
...
2
votes
1answer
55 views
Hibernate/JPA 2.0 - Table per Class and @EmbeddedId Inheritance
Aware as I am that @Embeddable components inheritance in Hibernate is not supported, I'm trying to find the best strategy to deal with my very custom entity mapping.
The story is as follows:
I have ...
0
votes
1answer
62 views
java.lang.NullPointerException at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:521)
I am new to hibernate, I just had some doubts and clarified in this website (One to many relationship and Other object relation).
For the same application i am facing different issue. the ...
0
votes
0answers
21 views
Fetch parent object using child in hibernate
I have an issue with hibernate mapping to retrieve parent using a child object. Below are the details -
TABLE_A
ID VAL
1 A
2 B
3 C
4 D
...