-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: one-to-many batch updating
PostPosted: Fri Jul 14, 2006 3:05 pm 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

My goal: everytime when I update the teacher, I will reassign the students to this teacher, for example, Case A: Teacher 1 have student 1,2,3, now I want to assign 4 to this teacher, but remove 1,2,3. Case B: Teacher 1 have student 1,2,3, now I want to assign 1,4,5 to this teacher

My question is, Do I need to run the query (marked in the //NOTE below),or hibernate itself will figure that out?I tried that a couple times, it seems I have to do the deletion manually, or I just doing something wrong?

Hibernate version:
3.1.3

Mapping documents:
Domain objects:
DomainTeacher.java
DomainStudent.java


DB objects:
Teacher.java
private int teacherid;
private String teachername;
private Set students;
//getter and setter
-----------------------------------
teacher.hbm.xml
<class name="Teacher" table="Teacher">
<id name="teacerid" column="TeacherID" type="java.lang.Integer">
<generator class="identity" />
</id>

<property name="teachername" column="teachername" type="java.lang.String"/>
<set name="students" inverse = "true" cascade = "all">
<key column="TeacherID" /> <one-to-many class="Student"/>
</set>


Student.java
private Teacher teacher;
private studentname;
//getter and setter

public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Student)) return false;
final Student stu = (Student) o;
if (!this.teacher.equals(stu.getTeacher()) return false;
if (!studentname.equals(stu.getStudentname)) return false;
return true;
}

public int hashCode() {
int result;
result = this.teacher.hashCode();
result = 29 * result + this.studentname.hashCode();
return result;
}

----------------------------------------
student.hbm.xml
<class name="Student" table="Student">
<composite-id>
<key-many-to-one name="Teacher" class="Teacher" column="TeacherID"/>
<key-property name="studentname" column="studentname" type="java.lang.Integer"/>
</composite-id>


Code between sessionFactory.openSession() and session.close():
TeacherDAO:

public void updateTeacher(DomainTeacher domainTeacher ){
int teacherId = domainTeacher.getTeacherid();
Teacher teacher = (Teacher)session.get(Teacher.class, teacherid)
teacher.setTeachername(domainTeacher.getTeachername);

//NOTE: Delete the exisiting students
Query q = session.createQuery("DELETE FROM Student
WHERE teacherid = :teacherId");
q.setInteger("teacherId",teacherId);
q.executeUpdate();

Set<Student> students = new HashSet<Student>();
Set<DomainStudent> domainStudents = domainTeacher.getDomainStudents();
for(DomainStudent ds: domainStudents){
Student student = new Student();
student.setTeacher(teacher);
student.setStudentname(ds.getStudentname());
students.add(student);
}

teacher.setStudents(students);
session.save(teacher);
}


Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 3:35 pm 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
Code:
<class name="Teacher" table="Teacher">
   <id name="teacerid" column="TeacherID" type="java.lang.Integer">
      <generator class="identity" />
   </id>

   <property name="teachername" column="teachername" type="java.lang.String"/>

   <set name="students" inverse = "true" cascade = "all-delete-orphan">
      <key column="TeacherID" />
      <one-to-many class="Student"/>
   </set>
</class>


Code:
public void updateTeacher(DomainTeacher domainTeacher ){
   int teacherId = domainTeacher.getTeacherid();
   Teacher teacher = (Teacher)session.get(Teacher.class, teacherid)
   teacher.setTeachername(domainTeacher.getTeachername);

   Set<DomainStudent> domainStudents = domainTeacher.getDomainStudents();
   for ( DomainStudent ds: domainStudents ) {
      Student student = new Student();
      student.setStudentname( ds.getStudentname() );
      if ( !teacher.getStudents().contains( student ) ) {
         student.setTeacher(teacher);
         teacher.getStudents().add( student );
      }
   }
   
   Set<DomainStudent> deleteStudents = domainTeacher.getDeleteStudents();
   for ( DomainStudent ds: deleteStudents ) {
      Student student = new Student();
      student.setStudentname( ds.getStudentname() );
      if ( teacher.getStudents().contains( student ) ) {
         teacher.getStudents().remove( student );
      }
   }

   session.saveOrUpdate(teacher);
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 5:00 pm 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
Thanks for your reply.

The second part of your codes,
Set<DomainStudent> deleteStudents = domainTeacher.getDeleteStudents();

You assumed that I will have a getDeleteStudents method, which can keep track with which students have been removed from the original SET. But my current situation is, after the GUI get a SET of students, the user add/remove some students, and send a new SET which only contains the students it want to keep. On the server side, if I need to implement getDeletedStudents(), I have to either maintain the status of the original SET which I sent to the GUI, or load it again from the database, but it looks neither one is a good solution.

As I know, for the many-to-many mapping, hibernate can delete the mapping and have a new insert automatically whenever there is an update.

[many-to-many sample]
Table: School, Teacher, School_Teacher
Class: School, Teacher, SchoolTeacher

school.hbm.xml
<set name="teachers" table="School_Teacher">
<key column="SchoolID" />
<many-to-many column="TeacherID" class="Teacher">
</many-to-many>
</set>

So, I just need to do:
Set<Teacher> teachers = new HashSet<Teacher>();
...
school.setTeachers(teachers);
...
session.saveOrUpdate(school);

That's it, hibernate will do the rest, I don't need to have any "if school contains ..." before I do the update, Does anybody know how to implement the same thing in one-to-many?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 1:06 pm 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
A similar discussion in JavaRanch, no solution
http://saloon.javaranch.com/cgi-bin/ubb ... 8&t=001697

I believe this is a common practise, anybody?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 1:24 pm 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
all-delete-orphan works if you use the same instance of the collection that was returned by Hibernate and not replace it with a completely new instance.

Suppose you fetch a teacher that has a set of students.

Set students;

In the UI, if you add/remove from "students" collection then hibernate will automatically take care of deletions.

If you have maintained another collection let say 'studentsUI' which is a new collection, then you would have to do the following:

students.clear(); //clear the original collection
students.addAll(studentsUI); // add contents of the new collection.

If you directly use "studentsUI", no deletion will take place.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 2:28 pm 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
I tried this before, it works only when the new set doesn't contain the element already exists in database. For example,

Teacher #1 has student #2, the new set comes from the UI is #3, yes, it can delete the exisiting student #2, and only save #3.

But if the new set has #2, #3, it will throw an exception:

org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:

Or I still get something wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 2:47 pm 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
JayeshJ wrote:
all-delete-orphan works if you use the same instance of the collection that was returned by Hibernate and not replace it with a completely new instance.

Suppose you fetch a teacher that has a set of students.
Set students;

In the UI, if you add/remove from "students" collection then hibernate will automatically take care of deletions.


Also, in my case the UI cannot manipulate the HIBERNATE students collection directly, I have to transform it from a DOMAIN students collection, which was shown in my previous posts.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 10:22 am 
Newbie

Joined: Wed Apr 20, 2005 1:06 pm
Posts: 8
Does anybody come out a solution for this one-to-many batch update?
Don't ask me to read the manual, I already did.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 5:03 am 
Beginner
Beginner

Joined: Sat Apr 07, 2007 4:42 pm
Posts: 24
Hi,

I have the same problem.

Any solution now available?

Thanx.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 2:00 pm 
Newbie

Joined: Tue Sep 25, 2007 1:56 pm
Posts: 1
Hi,

I too have the same problem.

Any solution now available ?

Thanx In Advance


Top
 Profile  
 
 Post subject: I think the solution is from the hibernate side
PostPosted: Thu Dec 27, 2007 5:41 am 
Beginner
Beginner

Joined: Fri Apr 20, 2007 10:48 am
Posts: 49
Location: France
Hi,

I have the same problem so I came to see if workarounds were found. I think the solution must come from hibernate:

When we replace our existing Set with another instance (I suppose when we come from detached mode also), we expect Hibernate to update the db with what we pass to it.

If hibernate is able to detect it doesn't know the Set instance, why doesn't it simply go and delete all existing entries before doing its (actual) inserts.

Emulating this feature is maybe possible with JPA's @PreUpdate mecanism, but it's still a workaround, we must place it on every Pojo.

_________________
Regards,
Zied Hamdi


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 5:43 am 
Beginner
Beginner

Joined: Fri Apr 20, 2007 10:48 am
Posts: 49
Location: France
Hi all,

I'm going crazy. I've attempted to do what is described by bkmr_77 (in a more generic way) see the code:

Code:
   public void setPlanEntries(Set<P> workExecutions) {
      if( planEntries != null  && workExecutions != null && (planEntries instanceof PersistentSet) && ( (PersistentSet)planEntries).wasInitialized() ) {
         List<P> toRemove = new ArrayList<P>();
         for( P p : planEntries ) {
            if( !workExecutions.contains( p ))
               toRemove.add( p );            
         }
         for( P rem : toRemove ) {
            planEntries.remove( rem );
         }
         for( P p : workExecutions ) {
            if( !planEntries.contains( p ))
               planEntries.add( p );            
         }
      }
      this.planEntries = workExecutions;
   }


I had the intention to put the code snippet in a HibernateUtil class. The problem is that it doesn't work: new entries are inserted but removed ones doesn't.

I'm under JPA with hibernate 3.3 in a JTA transaction.

The biggest problem is because I'm in a managed transaction mode, the simple fact of doing an em.find() of the "collection holder" (the parent) makes merging automatic because I remain attached to the session.

I've verified: the code really enters the snippet where objects are removed from the set, but only the ones added are synchronized:

Is there any other condition than being attached and removing entries directly from the Hibernate collection?

Quote:
10:16:16,125 INFO [STDOUT] Hibernate: select workplanni0_.ID as ID33_40_, workplanni0_.startDate as startDate33_40_, workplanni0_.note as note33_40_, workplanni0_.endDate as endDate33_40_, workplanni0_.lastOccurence as lastOccu5_33_40_, workplanni0_.source_id as source12_33_40_, workplanni0_.PERFORMER_ID as PERFORMER13_33_40_, workplanni0_.owner_id as owner14_33_40_, workplanni0_.description as descript6_33_40_, workplanni0_.planningEndDate as planning7_33_40_, workplanni0_.subscriptionDate as subscrip8_33_40_, workplanni0_.title as title33_40_, workplanni0_.client_id as client11_33_40_, workplanni0_.invoicePeriod as invoice10_33_40_, commercial1_.ID as ID15_0_, commercial1_.startDate as startDate15_0_, commercial1_.note as note15_0_, commercial1_.endDate as endDate15_0_, commercial1_.lastOccurence as lastOccu5_15_0_, commercial1_.source_id as source18_15_0_, commercial1_.PERFORMER_ID as PERFORMER16_15_0_, commercial1_.firstName as firstName15_0_, commercial1_.lastName as lastName15_0_, commercial1_.entryDate as entryDate15_0_, commercial1_.exitDate as exitDate15_0_, commercial1_.gender as gender15_0_, commercial1_.birthDate as birthDate15_0_, commercial1_.agency_adress as agency14_15_0_, commercial1_.boss_id as boss17_15_0_, commercial1_.socialNumber as socialN12_15_0_, commercial1_.referenceSalary as referen13_15_0_, commercial1_.salary_formula as salary15_15_0_, adresses2_.person_id as person10_42_, adresses2_.id as id42_, adresses2_.id as id16_1_, adresses2_.number as number16_1_, adresses2_.country as country16_1_, adresses2_.postalCode as postalCode16_1_, adresses2_.street as street16_1_, adresses2_.specifier as specifier16_1_, adresses2_.town as town16_1_, adresses2_.city as city16_1_, adresses2_.type as type16_1_, adresses2_.person_id as person10_16_1_, phones3_.person_id as person6_43_, phones3_.id as id43_, phones3_.id as id17_2_, phones3_.type as type17_2_, phones3_.number as number17_2_, phones3_.note as note17_2_, phones3_.main as main17_2_, phones3_.person_id as person6_17_2_, mails4_.person_id as person4_44_, mails4_.id as id44_, mails4_.id as id18_3_, mails4_.note as note18_3_, mails4_.person_id as person4_18_3_, mails4_.mail as mail18_3_, agencyadre5_.id as id0_4_, agencyadre5_.number as number0_4_, agencyadre5_.country as country0_4_, agencyadre5_.postalCode as postalCode0_4_, agencyadre5_.street as street0_4_, agencyadre5_.specifier as specifier0_4_, agencyadre5_.town as town0_4_, agencyadre5_.city as city0_4_, agencyadre5_.name as name0_4_, commercial6_.ID as ID15_5_, commercial6_.startDate as startDate15_5_, commercial6_.note as note15_5_, commercial6_.endDate as endDate15_5_, commercial6_.lastOccurence as lastOccu5_15_5_, commercial6_.source_id as source18_15_5_, commercial6_.PERFORMER_ID as PERFORMER16_15_5_, commercial6_.firstName as firstName15_5_, commercial6_.lastName as lastName15_5_, commercial6_.entryDate as entryDate15_5_, commercial6_.exitDate as exitDate15_5_, commercial6_.gender as gender15_5_, commercial6_.birthDate as birthDate15_5_, commercial6_.agency_adress as agency14_15_5_, commercial6_.boss_id as boss17_15_5_, commercial6_.socialNumber as socialN12_15_5_, commercial6_.referenceSalary as referen13_15_5_, commercial6_.salary_formula as salary15_15_5_, commercial7_.id as id20_6_, commercial7_.name as name20_6_, commercial7_.language as language20_6_, commercial7_.description as descript4_20_6_, commercial7_.formula as formula20_6_, params8_.formula_id as formula5_45_, params8_.id as id45_, params8_.id as id21_7_, params8_.name as name21_7_, params8_.value as value21_7_, params8_.required as required21_7_, params8_.formula_id as formula5_21_7_, planning9_.planning_id as planning7_46_, planning9_.id as id46_, planning9_.id as id34_8_, planning9_.priority as priority34_8_, planning9_.category_id as category12_34_8_, planning9_.note as note34_8_, planning9_.planning_id as planning7_34_8_, planning9_.workStart as workStart34_8_, planning9_.workEnd as workEnd34_8_, planning9_.planEnd as planEnd34_8_, planning9_.intervenant_id as interve10_34_8_, planning9_.salary_formula as salary9_34_8_, planning9_.invoice_formula as invoice11_34_8_, planning9_.referenceTaskPrice as referenc8_34_8_, category10_.id as id22_9_, category10_.name as name22_9_, category10_.salary_formula as salary4_22_9_, category10_.parent_category as parent3_22_9_, category10_.invoice_formula as invoice5_22_9_, intervenan11_.id as id11_10_, intervenan11_.name as name11_10_, intervenan11_.language as language11_10_, intervenan11_.description as descript4_11_10_, intervenan11_.formula as formula11_10_, params12_.formula_id as formula5_47_, params12_.id as id47_, params12_.id as id12_11_, params12_.name as name12_11_, params12_.value as value12_11_, params12_.required as required12_11_, params12_.formula_id as formula5_12_11_, category13_.id as id22_12_, category13_.name as name22_12_, category13_.salary_formula as salary4_22_12_, category13_.parent_category as parent3_22_12_, category13_.invoice_formula as invoice5_22_12_, invoicefor14_.id as id26_13_, invoicefor14_.name as name26_13_, invoicefor14_.language as language26_13_, invoicefor14_.description as descript4_26_13_, invoicefor14_.formula as formula26_13_, params15_.formula_id as formula5_48_, params15_.id as id48_, params15_.id as id27_14_, params15_.name as name27_14_, params15_.value as value27_14_, params15_.required as required27_14_, params15_.formula_id as formula5_27_14_, invoicefor16_.category_id as category4_49_, invoicefor16_.id as id49_, invoicefor16_.id as id28_15_, invoicefor16_.value as value28_15_, invoicefor16_.category_id as category4_28_15_, invoicefor16_.formulaParameter_id as formulaP3_28_15_, invoicefor17_.id as id27_16_, invoicefor17_.name as name27_16_, invoicefor17_.value as value27_16_, invoicefor17_.required as required27_16_, invoicefor17_.formula_id as formula5_27_16_, planentrie18_.plan_id as plan9_50_, planentrie18_.id as id50_, planentrie18_.id as id36_17_, planentrie18_.state as state36_17_, planentrie18_.note as note36_17_, planentrie18_.workStart as workStart36_17_, planentrie18_.plan_id as plan9_36_17_, planentrie18_.workEnd as workEnd36_17_, planentrie18_.intervenant_id as interven8_36_17_, planentrie18_.cancellationCause as cancella6_36_17_, planentrie18_.stateSaver as stateSaver36_17_, intervenan19_.ID as ID6_18_, intervenan19_.startDate as startDate6_18_, intervenan19_.note as note6_18_, intervenan19_.endDate as endDate6_18_, intervenan19_.lastOccurence as lastOccu5_6_18_, intervenan19_.source_id as source14_6_18_, intervenan19_.PERFORMER_ID as PERFORMER17_6_18_, intervenan19_.firstName as firstName6_18_, intervenan19_.lastName as lastName6_18_, intervenan19_.entryDate as entryDate6_18_, intervenan19_.exitDate as exitDate6_18_, intervenan19_.gender as gender6_18_, intervenan19_.birthDate as birthDate6_18_, intervenan19_.agency_adress as agency15_6_18_, intervenan19_.boss_id as boss16_6_18_, intervenan19_.socialNumber as socialN12_6_18_, intervenan19_.referenceSalary as referen13_6_18_, intervenan19_.salary_formula as salary18_6_18_, adresses20_.person_id as person10_51_, adresses20_.id as id51_, adresses20_.id as id7_19_, adresses20_.number as number7_19_, adresses20_.country as country7_19_, adresses20_.postalCode as postalCode7_19_, adresses20_.street as street7_19_, adresses20_.specifier as specifier7_19_, adresses20_.town as town7_19_, adresses20_.city as city7_19_, adresses20_.type as type7_19_, adresses20_.person_id as person10_7_19_, phones21_.person_id as person6_52_, phones21_.id as id52_, phones21_.id as id8_20_, phones21_.type as type8_20_, phones21_.number as number8_20_, phones21_.note as note8_20_, phones21_.main as main8_20_, phones21_.person_id as person6_8_20_, mails22_.person_id as person4_53_, mails22_.id as id53_, mails22_.id as id9_21_, mails22_.note as note9_21_, mails22_.person_id as person4_9_21_, mails22_.mail as mail9_21_, agencyadre23_.id as id0_22_, agencyadre23_.number as number0_22_, agencyadre23_.country as country0_22_, agencyadre23_.postalCode as postalCode0_22_, agencyadre23_.street as street0_22_, agencyadre23_.specifier as specifier0_22_, agencyadre23_.town as town0_22_, agencyadre23_.city as city0_22_, agencyadre23_.name as name0_22_, intervenan24_.ID as ID6_23_, intervenan24_.startDate as startDate6_23_, intervenan24_.note as note6_23_, intervenan24_.endDate as endDate6_23_, intervenan24_.lastOccurence as lastOccu5_6_23_, intervenan24_.source_id as source14_6_23_, intervenan24_.PERFORMER_ID as PERFORMER17_6_23_, intervenan24_.firstName as firstName6_23_, intervenan24_.lastName as lastName6_23_, intervenan24_.entryDate as entryDate6_23_, intervenan24_.exitDate as exitDate6_23_, intervenan24_.gender as gender6_23_, intervenan24_.birthDate as birthDate6_23_, intervenan24_.agency_adress as agency15_6_23_, intervenan24_.boss_id as boss16_6_23_, intervenan24_.socialNumber as socialN12_6_23_, intervenan24_.referenceSalary as referen13_6_23_, intervenan24_.salary_formula as salary18_6_23_, intervenan25_.id as id11_24_, intervenan25_.name as name11_24_, intervenan25_.language as language11_24_, intervenan25_.description as descript4_11_24_, intervenan25_.formula as formula11_24_, invoicewor26_.id as id24_25_, invoicewor26_.invoice_id as invoice7_24_25_, invoicewor26_.work_id as work8_24_25_, invoicewor26_.salary as salary24_25_, invoicewor26_.salarySpecialAmount as salarySp2_24_25_, invoicewor26_.invoiceSpecialAmount as invoiceS3_24_25_, invoicewor26_.salaryAmount as salaryAm4_24_25_, invoicewor26_.invoiceAmount as invoiceA5_24_25_, invoice27_.id as id23_26_, invoice27_.startDate as startDate23_26_, invoice27_.client_id as client6_23_26_, invoice27_.commercial_id as commercial5_23_26_, invoice27_.endDate as endDate23_26_, invoice27_.amount as amount23_26_, client28_.ID as ID1_27_, client28_.startDate as startDate1_27_, client28_.note as note1_27_, client28_.endDate as endDate1_27_, client28_.lastOccurence as lastOccu5_1_27_, client28_.source_id as source14_1_27_, client28_.PERFORMER_ID as PERFORMER13_1_27_, client28_.firstName as firstName1_27_, client28_.lastName as lastName1_27_, client28_.entryDate as entryDate1_27_, client28_.exitDate as exitDate1_27_, client28_.gender as gender1_27_, client28_.birthDate as birthDate1_27_, client28_.agency_adress as agency12_1_27_, adresses29_.person_id as person10_54_, adresses29_.id as id54_, adresses29_.id as id2_28_, adresses29_.number as number2_28_, adresses29_.country as country2_28_, adresses29_.postalCode as postalCode2_28_, adresses29_.street as street2_28_, adresses29_.specifier as specifier2_28_, adresses29_.town as town2_28_, adresses29_.city as city2_28_, adresses29_.type as type2_28_, adresses29_.person_id as person10_2_28_, phones30_.person_id as person6_55_, phones30_.id as id55_, phones30_.id as id3_29_, phones30_.type as type3_29_, phones30_.number as number3_29_, phones30_.note as note3_29_, phones30_.main as main3_29_, phones30_.person_id as person6_3_29_, mails31_.person_id as person4_56_, mails31_.id as id56_, mails31_.id as id4_30_, mails31_.note as note4_30_, mails31_.person_id as person4_4_30_, mails31_.mail as mail4_30_, agencyadre32_.id as id0_31_, agencyadre32_.number as number0_31_, agencyadre32_.country as country0_31_, agencyadre32_.postalCode as postalCode0_31_, agencyadre32_.street as street0_31_, agencyadre32_.specifier as specifier0_31_, agencyadre32_.town as town0_31_, agencyadre32_.city as city0_31_, agencyadre32_.name as name0_31_, commercial33_.ID as ID15_32_, commercial33_.startDate as startDate15_32_, commercial33_.note as note15_32_, commercial33_.endDate as endDate15_32_, commercial33_.lastOccurence as lastOccu5_15_32_, commercial33_.source_id as source18_15_32_, commercial33_.PERFORMER_ID as PERFORMER16_15_32_, commercial33_.firstName as firstName15_32_, commercial33_.lastName as lastName15_32_, commercial33_.entryDate as entryDate15_32_, commercial33_.exitDate as exitDate15_32_, commercial33_.gender as gender15_32_, commercial33_.birthDate as birthDate15_32_, commercial33_.agency_adress as agency14_15_32_, commercial33_.boss_id as boss17_15_32_, commercial33_.socialNumber as socialN12_15_32_, commercial33_.referenceSalary as referen13_15_32_, commercial33_.salary_formula as salary15_15_32_, intervenan34_.id as id31_33_, intervenan34_.startDate as startDate31_33_, intervenan34_.note as note31_33_, intervenan34_.endDate as endDate31_33_, intervenan34_.amount as amount31_33_, intervenan34_.employee as employee31_33_, intervenan35_.ID as ID6_34_, intervenan35_.startDate as startDate6_34_, intervenan35_.note as note6_34_, intervenan35_.endDate as endDate6_34_, intervenan35_.lastOccurence as lastOccu5_6_34_, intervenan35_.source_id as source14_6_34_, intervenan35_.PERFORMER_ID as PERFORMER17_6_34_, intervenan35_.firstName as firstName6_34_, intervenan35_.lastName as lastName6_34_, intervenan35_.entryDate as entryDate6_34_, intervenan35_.exitDate as exitDate6_34_, intervenan35_.gender as gender6_34_, intervenan35_.birthDate as birthDate6_34_, intervenan35_.agency_adress as agency15_6_34_, intervenan35_.boss_id as boss16_6_34_, intervenan35_.socialNumber as socialN12_6_34_, intervenan35_.referenceSalary as referen13_6_34_, intervenan35_.salary_formula as salary18_6_34_, intervenan36_.ID as ID6_35_, intervenan36_.startDate as startDate6_35_, intervenan36_.note as note6_35_, intervenan36_.endDate as endDate6_35_, intervenan36_.lastOccurence as lastOccu5_6_35_, intervenan36_.source_id as source14_6_35_, intervenan36_.PERFORMER_ID as PERFORMER17_6_35_, intervenan36_.firstName as firstName6_35_, intervenan36_.lastName as lastName6_35_, intervenan36_.entryDate as entryDate6_35_, intervenan36_.exitDate as exitDate6_35_, intervenan36_.gender as gender6_35_, intervenan36_.birthDate as birthDate6_35_, intervenan36_.agency_adress as agency15_6_35_, intervenan36_.boss_id as boss16_6_35_, intervenan36_.socialNumber as socialN12_6_35_, intervenan36_.referenceSalary as referen13_6_35_, intervenan36_.salary_formula as salary18_6_35_, intervenan37_.id as id11_36_, intervenan37_.name as name11_36_, intervenan37_.language as language11_36_, intervenan37_.description as descript4_11_36_, intervenan37_.formula as formula11_36_, invoicefor38_.id as id26_37_, invoicefor38_.name as name26_37_, invoicefor38_.language as language26_37_, invoicefor38_.description as descript4_26_37_, invoicefor38_.formula as formula26_37_, workrepeti39_.id as id35_38_, workrepeti39_.day as day35_38_, workrepeti39_.calendar_plan_id as calendar5_35_38_, workrepeti39_.periodicity as periodic3_35_38_, workrepeti39_.periodicityFacor as periodic4_35_38_, client40_.ID as ID1_39_, client40_.startDate as startDate1_39_, client40_.note as note1_39_, client40_.endDate as endDate1_39_, client40_.lastOccurence as lastOccu5_1_39_, client40_.source_id as source14_1_39_, client40_.PERFORMER_ID as PERFORMER13_1_39_, client40_.firstName as firstName1_39_, client40_.lastName as lastName1_39_, client40_.entryDate as entryDate1_39_, client40_.exitDate as exitDate1_39_, client40_.gender as gender1_39_, client40_.birthDate as birthDate1_39_, client40_.agency_adress as agency12_1_39_ from WorkPlanningContract workplanni0_ left outer join Commercial commercial1_ on workplanni0_.owner_id=commercial1_.ID left outer join CommercialAdress adresses2_ on commercial1_.ID=adresses2_.person_id left outer join CommercialPhoneNumber phones3_ on commercial1_.ID=phones3_.person_id left outer join CommercialMailAdress mails4_ on commercial1_.ID=mails4_.person_id left outer join AgencyAdress agencyadre5_ on commercial1_.agency_adress=agencyadre5_.id left outer join Commercial commercial6_ on commercial1_.boss_id=commercial6_.ID left outer join CommercialSalaryFormula commercial7_ on commercial6_.salary_formula=commercial7_.id left outer join CommercialSalaryFormulaParameter params8_ on commercial7_.id=params8_.formula_id left outer join WorkTask planning9_ on workplanni0_.ID=planning9_.planning_id left outer join Category category10_ on planning9_.category_id=category10_.id left outer join IntervenantSalaryFormula intervenan11_ on category10_.salary_formula=intervenan11_.id left outer join IntervenantSalaryFormulaParameter params12_ on intervenan11_.id=params12_.formula_id left outer join Category category13_ on category10_.parent_category=category13_.id left outer join InvoiceFormula invoicefor14_ on category13_.invoice_formula=invoicefor14_.id left outer join InvoiceFormulaParameter params15_ on invoicefor14_.id=params15_.formula_id left outer join InvoiceCategoryFPV invoicefor16_ on category13_.id=invoicefor16_.category_id left outer join InvoiceFormulaParameter invoicefor17_ on invoicefor16_.formulaParameter_id=invoicefor17_.id left outer join WorkExecution planentrie18_ on planning9_.id=planentrie18_.plan_id left outer join Intervenant intervenan19_ on planentrie18_.intervenant_id=intervenan19_.ID left outer join IntervenantAdress adresses20_ on intervenan19_.ID=adresses20_.person_id left outer join IntervenantPhoneNumber phones21_ on intervenan19_.ID=phones21_.person_id left outer join IntervenantMailAdress mails22_ on intervenan19_.ID=mails22_.person_id left outer join AgencyAdress agencyadre23_ on intervenan19_.agency_adress=agencyadre23_.id left outer join Intervenant intervenan24_ on intervenan19_.boss_id=intervenan24_.ID left outer join IntervenantSalaryFormula intervenan25_ on intervenan24_.salary_formula=intervenan25_.id left outer join InvoiceWorkDetail invoicewor26_ on planentrie18_.id=invoicewor26_.work_id left outer join Invoice invoice27_ on invoicewor26_.invoice_id=invoice27_.id left outer join Client client28_ on invoice27_.client_id=client28_.ID left outer join ClientAdress adresses29_ on client28_.ID=adresses29_.person_id left outer join ClientPhoneNumber phones30_ on client28_.ID=phones30_.person_id left outer join ClientMailAdress mails31_ on client28_.ID=mails31_.person_id left outer join AgencyAdress agencyadre32_ on client28_.agency_adress=agencyadre32_.id left outer join Commercial commercial33_ on invoice27_.commercial_id=commercial33_.ID left outer join IntervenantSalary intervenan34_ on invoicewor26_.salary=intervenan34_.id left outer join Intervenant intervenan35_ on intervenan34_.employee=intervenan35_.ID left outer join Intervenant intervenan36_ on planning9_.intervenant_id=intervenan36_.ID left outer join IntervenantSalaryFormula intervenan37_ on planning9_.salary_formula=intervenan37_.id left outer join InvoiceFormula invoicefor38_ on planning9_.invoice_formula=invoicefor38_.id left outer join WorkRepetitionPlan workrepeti39_ on planning9_.id=workrepeti39_.calendar_plan_id left outer join Client client40_ on workplanni0_.client_id=client40_.ID where workplanni0_.ID=?
10:16:16,328 INFO [STDOUT] Hibernate: select invoicefor0_.id as id26_1_, invoicefor0_.name as name26_1_, invoicefor0_.language as language26_1_, invoicefor0_.description as descript4_26_1_, invoicefor0_.formula as formula26_1_, params1_.formula_id as formula5_3_, params1_.id as id3_, params1_.id as id27_0_, params1_.name as name27_0_, params1_.value as value27_0_, params1_.required as required27_0_, params1_.formula_id as formula5_27_0_ from InvoiceFormula invoicefor0_ left outer join InvoiceFormulaParameter params1_ on invoicefor0_.id=params1_.formula_id where invoicefor0_.id=?
10:16:16,328 INFO [STDOUT] Hibernate: select mails0_.person_id as person4_1_, mails0_.id as id1_, mails0_.id as id4_0_, mails0_.note as note4_0_, mails0_.person_id as person4_4_0_, mails0_.mail as mail4_0_ from ClientMailAdress mails0_ where mails0_.person_id=?
10:16:16,343 INFO [STDOUT] Hibernate: select phones0_.person_id as person6_1_, phones0_.id as id1_, phones0_.id as id3_0_, phones0_.type as type3_0_, phones0_.number as number3_0_, phones0_.note as note3_0_, phones0_.main as main3_0_, phones0_.person_id as person6_3_0_ from ClientPhoneNumber phones0_ where phones0_.person_id=?
10:16:16,343 INFO [STDOUT] Hibernate: select adresses0_.person_id as person10_1_, adresses0_.id as id1_, adresses0_.id as id2_0_, adresses0_.number as number2_0_, adresses0_.country as country2_0_, adresses0_.postalCode as postalCode2_0_, adresses0_.street as street2_0_, adresses0_.specifier as specifier2_0_, adresses0_.town as town2_0_, adresses0_.city as city2_0_, adresses0_.type as type2_0_, adresses0_.person_id as person10_2_0_ from ClientAdress adresses0_ where adresses0_.person_id=?
10:16:16,343 INFO [STDOUT] Hibernate: select invoicefor0_.category_id as category4_3_, invoicefor0_.id as id3_, invoicefor0_.id as id28_2_, invoicefor0_.value as value28_2_, invoicefor0_.category_id as category4_28_2_, invoicefor0_.formulaParameter_id as formulaP3_28_2_, invoicefor1_.id as id27_0_, invoicefor1_.name as name27_0_, invoicefor1_.value as value27_0_, invoicefor1_.required as required27_0_, invoicefor1_.formula_id as formula5_27_0_, invoicefor2_.id as id26_1_, invoicefor2_.name as name26_1_, invoicefor2_.language as language26_1_, invoicefor2_.description as descript4_26_1_, invoicefor2_.formula as formula26_1_ from InvoiceCategoryFPV invoicefor0_ left outer join InvoiceFormulaParameter invoicefor1_ on invoicefor0_.formulaParameter_id=invoicefor1_.id left outer join InvoiceFormula invoicefor2_ on invoicefor1_.formula_id=invoicefor2_.id where invoicefor0_.category_id=?
10:17:16,468 INFO [STDOUT] Hibernate: insert into WorkExecution (state, note, workStart, plan_id, workEnd, intervenant_id, cancellationCause, stateSaver, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

_________________
Regards,
Zied Hamdi


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.