-->
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.  [ 1 post ] 
Author Message
 Post subject: unidirectional 1:N cascade save with foreign key in child
PostPosted: Wed Jun 29, 2005 10:13 pm 
Newbie

Joined: Wed Jun 29, 2005 7:54 pm
Posts: 1
Group class has a collection of Member class. However, Member does not have direct reference to the Group. Hence, it is unidirectional 1:N. However, there is a twist to it that Member class contains the Group ID, so that standalone Member's can identify their own groups quickly, and in most case Group ids are only needed when dealing with members.

My problem is that I can get the group and member created in the db with cascase save on the group object. However, I wouldn't figure how to get the group id inside Member to be populated by hibernate automatically.
This only happen in save(). I know getting members from the db will have the group id set.

I know I can use bidirectional mapping to solve this problem. However, bidirectional mapping does not sound to me because
- my client and server are in two JVM. Hibernate proxy won't work without addtional works.
- I don't need the entire Group object in Member, and I don't want to serialize Group inside Member accidently if server needs to do some work before passing the Member object back.

- I don't want to have a proxy Group inside Member just for accessing the group ID. I know the group id is cached in the proxy class. However, just having the proxy there is intrusive and give clients a false assumption that group object may be accessible.


For now, to get around the problem, I need to manually populate the group id in each Member after doing a cascade save. If not, the Member with null group id will be cached, and cost other problem.

Does anyone know a better solution?


Hibernate version: 3.0.5

Mapping documents:

Code:
   <class name="Group" table="`group`" >
      <id name="id" column="id" >
         <generator class="native" />
      </id>
      
      <property name="name" column="name" />
      
      <bag name="members" cascade="all" lazy="false" >
         <key column="group_id" not-null="true" />
         <one-to-many class="Member" />
      </bag>
   </class>


Code:
   <class name="Member" table="Member" >
      <id name="id" column="id" >
         <generator class="native" />
      </id>

        <property name="groupId" column="group_id" insert="false" update="false" not-null="true"/>
      <property name="userId" column="user_id" />      
   </class>


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

Code:
      Group group = new Group();
      group.setName("rtest" + Long.toHexString(System.currentTimeMillis()));
   
      for(int i=0;i<2;i++) {
         Member member = new Member();
         member.setUserId(new Long(i + 1));
         
         group.addMember(member);
      }

      log.debug("origGroup0=" + group);

      session.save(group);
         
      session.flush();

      log.debug("origGroup1=" + group);
      
      Criteria criteria = session.createCriteria(Group.class);
      
      criteria.add(Restrictions.eq("id", group.getId()));
         
      Group actualGroup = (Group) criteria.uniqueResult();
         
      log.debug("actualGroup=" + actualGroup);



Name and version of the database you are using:

MySQL 4.1

Group table :
Code:
CREATE TABLE `group` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(45) NOT NULL default '',
  PRIMARY KEY  (`id`)
   ....

Member table:

Code:
CREATE TABLE `member` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `user_id` int(10) unsigned NOT NULL default '0',
  `group_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `FK_member_1` (`group_id`),
   ...


Entity classes:

Code:
public class Group
{
   private Long mId;   // setters and getters exists
   private String mName;
   private Collection mMembers = new ArrayList();

   public void addMember(Member member)
   {
      mMembers.add(member);
   }

   public boolean equals(Object obj)
   {
      if(!(obj instanceof Group))
         return false;
      
      Group group = (Group) obj;
      
      return new EqualsBuilder().append(mName, group.mName).isEquals();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(mName).toHashCode();
   }
...



Code:
public class Member
{
   private Long mId;
   private Long mGroupId;
   private Long mUserId;

   public String toString()
   {
      return new ToStringBuilder(this)
         .append("id", mId)
         .append("group_id", mGroupId)
         .append("user_id", mUserId).toString();
   }
   
   public boolean equals(Object obj)
   {
      if(!(obj instanceof Member))
         return false;
      
      Member member = (Member) obj;
      return new EqualsBuilder().append(mGroupId, member.mGroupId).append(mUserId, member.mUserId).isEquals();
      
   }
   public int hashCode()
   {
      return new HashCodeBuilder().append(mGroupId).append(mUserId).toHashCode();
   }
   
....



The generated SQL (show_sql=true):
17:34:29,286 DEBUG org.hibernate.SQL: insert into `group` (name) values (?)
17:34:29,316 DEBUG org.hibernate.SQL: insert into Member (user_id, group_id) values (?, ?)
17:34:29,316 DEBUG org.hibernate.SQL: insert into Member (user_id, group_id) values (?, ?)
17:34:29,326 DEBUG org.hibernate.SQL: update Member set group_id=? where id=?
17:34:29,326 DEBUG org.hibernate.SQL: update Member set group_id=? where id=?
17:34:29,376 DEBUG org.hibernate.SQL: select this_.id as id0_, this_.name as name0_0_ from `group` this_ where this_.id=?

Debug level Hibernate log excerpt:

note: ran at different time from the sql log above


18:24:57,660 DEBUG org.hibernate.transaction.JDBCTransaction: begin
18:24:57,660 DEBUG org.hibernate.jdbc.ConnectionManager: opening JDBC connection
18:24:57,660 DEBUG org.hibernate.connection.DriverManagerConnectionProvider: total checked-out connections: 0
18:24:57,660 DEBUG org.hibernate.connection.DriverManagerConnectionProvider: using pooled JDBC connection, pool size: 0
18:24:57,660 DEBUG org.hibernate.transaction.JDBCTransaction: current autocommit status: false


18:24:57,670 INFO suggested_unidir.HibernateTest: origGroup0=suggested_unidir.Group@147c1db[mId=<null>,mName=rtest104cad8b8bc,mMembers=[suggested_unidir.Member@82d37[id=<null>,group_id=<null>,user_id=1], suggested_unidir.Member@d09ad3[id=<null>,group_id=<null>,user_id=2]]]


8:24:57,670 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: saving transient instance
18:24:57,670 DEBUG org.hibernate.event.def.AbstractSaveEventListener: saving [suggested_unidir.Group#<null>]
18:24:57,670 DEBUG org.hibernate.event.def.AbstractSaveEventListener: executing insertions
18:24:57,680 DEBUG org.hibernate.engine.Cascades: processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,680 DEBUG org.hibernate.engine.Cascades: done processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,690 DEBUG org.hibernate.event.def.WrapVisitor: Wrapped collection in role: suggested_unidir.Group.members
18:24:57,710 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Inserting entity: suggested_unidir.Group (native id)
18:24:57,710 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
18:24:57,710 DEBUG org.hibernate.SQL: insert into `group` (name) values (?)
18:24:57,710 DEBUG org.hibernate.jdbc.AbstractBatcher: preparing statement
18:24:57,730 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Dehydrating entity: [suggested_unidir.Group#<null>]
18:24:57,730 DEBUG org.hibernate.type.StringType: binding 'rtest104cad8b8bc' to parameter: 1
18:24:57,730 DEBUG org.hibernate.id.IdentifierGeneratorFactory: Natively generated identity: 81
18:24:57,730 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
18:24:57,730 DEBUG org.hibernate.jdbc.AbstractBatcher: closing statement
18:24:57,740 DEBUG org.hibernate.engine.Cascades: processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,740 DEBUG org.hibernate.engine.Cascades: cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,740 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,740 DEBUG org.hibernate.event.def.AbstractSaveEventListener: transient instance of: suggested_unidir.Member
18:24:57,740 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: saving transient instance
18:24:57,740 DEBUG org.hibernate.event.def.AbstractSaveEventListener: saving [suggested_unidir.Member#<null>]
18:24:57,740 DEBUG org.hibernate.event.def.AbstractSaveEventListener: executing insertions
18:24:57,740 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Inserting entity: suggested_unidir.Member (native id)
18:24:57,740 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
18:24:57,740 DEBUG org.hibernate.SQL: insert into Member (user_id, group_id) values (?, ?)
18:24:57,740 DEBUG org.hibernate.jdbc.AbstractBatcher: preparing statement
18:24:57,740 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Dehydrating entity: [suggested_unidir.Member#<null>]
18:24:57,740 DEBUG org.hibernate.type.LongType: binding '1' to parameter: 1
18:24:57,740 DEBUG org.hibernate.type.LongType: binding '81' to parameter: 2
18:24:57,740 DEBUG org.hibernate.id.IdentifierGeneratorFactory: Natively generated identity: 98
18:24:57,740 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
18:24:57,740 DEBUG org.hibernate.jdbc.AbstractBatcher: closing statement
18:24:57,740 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,750 DEBUG org.hibernate.event.def.AbstractSaveEventListener: transient instance of: suggested_unidir.Member
18:24:57,750 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: saving transient instance
18:24:57,750 DEBUG org.hibernate.event.def.AbstractSaveEventListener: saving [suggested_unidir.Member#<null>]
18:24:57,750 DEBUG org.hibernate.event.def.AbstractSaveEventListener: executing insertions
18:24:57,770 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Inserting entity: suggested_unidir.Member (native id)
18:24:57,770 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
18:24:57,770 DEBUG org.hibernate.SQL: insert into Member (user_id, group_id) values (?, ?)
18:24:57,770 DEBUG org.hibernate.jdbc.AbstractBatcher: preparing statement
18:24:57,770 DEBUG org.hibernate.persister.entity.BasicEntityPersister: Dehydrating entity: [suggested_unidir.Member#<null>]
18:24:57,770 DEBUG org.hibernate.type.LongType: binding '2' to parameter: 1
18:24:57,770 DEBUG org.hibernate.type.LongType: binding '81' to parameter: 2
18:24:57,770 DEBUG org.hibernate.id.IdentifierGeneratorFactory: Natively generated identity: 99
18:24:57,770 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
18:24:57,770 DEBUG org.hibernate.jdbc.AbstractBatcher: closing statement
18:24:57,770 DEBUG org.hibernate.engine.Cascades: done cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,770 DEBUG org.hibernate.engine.Cascades: done processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,770 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: flushing session
18:24:57,770 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: processing flush-time cascades
18:24:57,770 DEBUG org.hibernate.engine.Cascades: processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,770 DEBUG org.hibernate.engine.Cascades: cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,770 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,770 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,770 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,770 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#98]
18:24:57,770 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,770 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,770 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,770 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#99]
18:24:57,770 DEBUG org.hibernate.engine.Cascades: done cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,770 DEBUG org.hibernate.engine.Cascades: done processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,770 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: dirty checking collections
18:24:57,770 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushing entities and processing referenced collections
18:24:57,780 DEBUG org.hibernate.engine.Collections: Collection found: [suggested_unidir.Group.members#81], was: [<unreferenced>] (initialized)
18:24:57,780 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Processing unreferenced collections
18:24:57,780 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Scheduling collection removes/(re)creates/updates
18:24:57,780 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
18:24:57,780 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
18:24:57,780 DEBUG org.hibernate.pretty.Printer: listing entities:
18:24:57,780 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=2, id=99}
18:24:57,780 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=1, id=98}
18:24:57,780 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Group{members=[suggested_unidir.Member#98, suggested_unidir.Member#99], name=rtest104cad8b8bc, id=81}
18:24:57,780 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: executing flush
18:24:57,790 DEBUG org.hibernate.persister.collection.AbstractCollectionPersister: Inserting collection: [suggested_unidir.Group.members#81]
18:24:57,790 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
18:24:57,790 DEBUG org.hibernate.SQL: update Member set group_id=? where id=?
18:24:57,790 DEBUG org.hibernate.jdbc.AbstractBatcher: preparing statement
18:24:57,790 DEBUG org.hibernate.type.LongType: binding '81' to parameter: 1
18:24:57,790 DEBUG org.hibernate.type.LongType: binding '98' to parameter: 2
18:24:57,790 DEBUG org.hibernate.jdbc.AbstractBatcher: Adding to batch
18:24:57,790 DEBUG org.hibernate.jdbc.AbstractBatcher: reusing prepared statement
18:24:57,790 DEBUG org.hibernate.SQL: update Member set group_id=? where id=?
18:24:57,790 DEBUG org.hibernate.type.LongType: binding '81' to parameter: 1
18:24:57,790 DEBUG org.hibernate.type.LongType: binding '99' to parameter: 2
18:24:57,790 DEBUG org.hibernate.jdbc.AbstractBatcher: Adding to batch
18:24:57,790 DEBUG org.hibernate.persister.collection.AbstractCollectionPersister: done inserting collection: 2 rows inserted
18:24:57,800 DEBUG org.hibernate.jdbc.AbstractBatcher: Executing batch size: 2
18:24:57,800 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
18:24:57,800 DEBUG org.hibernate.jdbc.AbstractBatcher: closing statement
18:24:57,800 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: post flush


18:24:57,800 INFO suggested_unidir.HibernateTest: origGroup1=suggested_unidir.Group@147c1db[mId=81,mName=rtest104cad8b8bc,mMembers=[suggested_unidir.Member@82d37[id=98,group_id=<null>,user_id=1], suggested_unidir.Member@d09ad3[id=99,group_id=<null>,user_id=2]]]



18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: flushing session
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: processing flush-time cascades
18:24:57,820 DEBUG org.hibernate.engine.Cascades: processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,820 DEBUG org.hibernate.engine.Cascades: cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,820 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,820 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,820 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,820 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#98]
18:24:57,820 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,820 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,820 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,820 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#99]
18:24:57,820 DEBUG org.hibernate.engine.Cascades: done cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,820 DEBUG org.hibernate.engine.Cascades: done processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: dirty checking collections
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushing entities and processing referenced collections
18:24:57,820 DEBUG org.hibernate.engine.Collections: Collection found: [suggested_unidir.Group.members#81], was: [suggested_unidir.Group.members#81] (initialized)
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Processing unreferenced collections
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Scheduling collection removes/(re)creates/updates
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
18:24:57,820 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
18:24:57,820 DEBUG org.hibernate.pretty.Printer: listing entities:
18:24:57,820 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=2, id=99}
18:24:57,820 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=1, id=98}
18:24:57,820 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Group{members=[suggested_unidir.Member#98, suggested_unidir.Member#99], name=rtest104cad8b8bc, id=81}
18:24:57,820 DEBUG org.hibernate.event.def.DefaultAutoFlushEventListener: Dont need to execute flush
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
18:24:57,830 DEBUG org.hibernate.SQL: select this_.id as id0_, this_.name as name0_0_ from `group` this_ where this_.id=?
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: preparing statement
18:24:57,830 DEBUG org.hibernate.type.LongType: binding '81' to parameter: 1
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: about to open ResultSet (open ResultSets: 0, globally: 0)
18:24:57,830 DEBUG org.hibernate.loader.Loader: processing result set
18:24:57,830 DEBUG org.hibernate.loader.Loader: result set row: 0
18:24:57,830 DEBUG org.hibernate.type.LongType: returning '81' as column: id0_
18:24:57,830 DEBUG org.hibernate.loader.Loader: result row: EntityKey[suggested_unidir.Group#81]
18:24:57,830 DEBUG org.hibernate.loader.Loader: done processing result set (1 rows)
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close ResultSet (open ResultSets: 1, globally: 1)
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
18:24:57,830 DEBUG org.hibernate.jdbc.AbstractBatcher: closing statement
18:24:57,840 DEBUG org.hibernate.loader.Loader: total objects hydrated: 0
18:24:57,840 DEBUG org.hibernate.engine.PersistenceContext: initializing non-lazy collections


18:24:57,840 INFO suggested_unidir.HibernateTest: actualGroup=suggested_unidir.Group@147c1db[mId=81,mName=rtest104cad8b8bc,mMembers=[suggested_unidir.Member@82d37[id=98,group_id=<null>,user_id=1], suggested_unidir.Member@d09ad3[id=99,group_id=<null>,user_id=2]]]

18:24:57,840 DEBUG org.hibernate.transaction.JDBCTransaction: commit
18:24:57,840 DEBUG org.hibernate.impl.SessionImpl: automatically flushing session
18:24:57,840 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: flushing session
18:24:57,840 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: processing flush-time cascades
18:24:57,840 DEBUG org.hibernate.engine.Cascades: processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,840 DEBUG org.hibernate.engine.Cascades: cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,840 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,840 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,840 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,840 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#98]
18:24:57,840 DEBUG org.hibernate.engine.Cascades: cascading to saveOrUpdate: suggested_unidir.Member
18:24:57,840 DEBUG org.hibernate.event.def.AbstractSaveEventListener: persistent instance of: suggested_unidir.Member
18:24:57,840 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: ignoring persistent instance
18:24:57,840 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener: object already associated with session: [suggested_unidir.Member#99]
18:24:57,840 DEBUG org.hibernate.engine.Cascades: done cascade ACTION_SAVE_UPDATE for collection: suggested_unidir.Group.members
18:24:57,840 DEBUG org.hibernate.engine.Cascades: done processing cascade ACTION_SAVE_UPDATE for: suggested_unidir.Group
18:24:57,840 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: dirty checking collections
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushing entities and processing referenced collections
18:24:57,850 DEBUG org.hibernate.engine.Collections: Collection found: [suggested_unidir.Group.members#81], was: [suggested_unidir.Group.members#81] (initialized)
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Processing unreferenced collections
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Scheduling collection removes/(re)creates/updates
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
18:24:57,850 DEBUG org.hibernate.pretty.Printer: listing entities:
18:24:57,850 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=2, id=99}
18:24:57,850 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Member{groupId=null, userId=1, id=98}
18:24:57,850 DEBUG org.hibernate.pretty.Printer: suggested_unidir.Group{members=[suggested_unidir.Member#98, suggested_unidir.Member#99], name=rtest104cad8b8bc, id=81}
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: executing flush
18:24:57,850 DEBUG org.hibernate.event.def.AbstractFlushingEventListener: post flush
18:24:57,850 DEBUG org.hibernate.jdbc.JDBCContext: before transaction completion
18:24:57,850 DEBUG org.hibernate.impl.SessionImpl: before transaction completion
18:24:57,890 DEBUG org.hibernate.transaction.JDBCTransaction: committed JDBC Connection
18:24:57,890 DEBUG org.hibernate.jdbc.JDBCContext: after transaction completion
18:24:57,890 DEBUG org.hibernate.impl.SessionImpl: after transaction completion
18:24:57,890 DEBUG org.hibernate.impl.SessionImpl: closing session
18:24:57,890 DEBUG org.hibernate.jdbc.ConnectionManager: closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
18:24:57,890 DEBUG org.hibernate.connection.DriverManagerConnectionProvider: returning connection to pool, pool size: 1
18:24:57,890 DEBUG org.hibernate.jdbc.JDBCContext: after transaction completion
18:24:57,890 DEBUG org.hibernate.impl.SessionImpl: after transaction completion


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

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.