-->
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: PostInsertEventListener or SaveOrUpdateEventListener
PostPosted: Wed Jan 28, 2015 4:51 pm 
Newbie

Joined: Wed Jan 28, 2015 4:32 pm
Posts: 1
I am using hibernate 4.3.8.Final and trying to implement either the PostInsertEventListener or SaveOrUpdateEventListener.

I have implemented a classes which implements these. These implementations simply contain the require method and each method performs a System.out.println.

Here is what I have added to my hibernate.cfg.xml:

Code:
      <mapping class="com.hib.entities.DeviceData"></mapping>
      
      <listener class="com.hib.listeners.PostInsertListener" type="post-insert" />
      <listener class="com.hib.listeners.SaveUpdateListener" type="save-update" />

   </session-factory>


When I run my application, I don't see any of the system.outs.


Here the code that is being used to add rows:


Code:
      session.beginTransaction();        

      DeviceData deviceData = new DeviceData(deviceName, deviceStatus);

      session.saveOrUpdate(deviceData);
      session.getTransaction().commit(); 



Could anyone help me out? Have spent several hours with google and have yet to find anything that helps.


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.