Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Sharing using information with an entity listener
Sharing using information with an entity listener [message #551010] Wed, 04 August 2010 20:12 Go to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
The following code is a correct and good aproach to pass the name of the system user to an entity listener?

// My bussiness code:
Session unitOfWork =  JpaHelper.getEntityManager(em).getUnitOfWork(); 
unitOfWork.setProperty("user", user);	 

// My entity listener code: 
class MyEntityListener extends DescriptorEventAdapter {

  public void preUpdateWithChanges(DescriptorEvent event) {
    Session unitOfWork = event.getSession();  
System.out.println("User doing the merge  = " +  unitOfWork.getProperty("user"));

Thaks for some help. Mauro.
Re: Sharing using information with an entity listener [message #551779 is a reply to message #551010] Mon, 09 August 2010 14:19 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems fine.

James : Wiki : Book : Blog : Twitter
Previous Topic:Difficulties Unmarshalling Timestamp
Next Topic:Eclipselink and JBoss 5.1
Goto Forum:

Current Time: Sat Apr 21 02:13:19 GMT 2018

Powered by FUDForum. Page generated in 0.02195 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software