cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Jarrel" <garyjar...@gmail.com>
Subject Lifecycle Callbacks!
Date Fri, 12 Oct 2007 10:55:30 GMT
Hi Guys!

I've just delved into using lifecycle callbacks for the first time,
and I can't seem to get my call back to fire in what seems to be a
relatively simple code:

LifecycleCallbackRegistry registry = context.getEntityResolver()
				.getCallbackRegistry();
LifecycleListener listener = new AttributeChangeListener();
registry.addDefaultListener(listener);
News news = (News) DataObjectUtils.objectForPK(this.context, News.class, 1);
assertNotNull(news);
System.err.println(news);
news.setBody("test");
context.commitChanges();
System.err.println(news);

I have read over the manual chapter on call backs a few times, and
can't seem to find what I'm doing wrong - but it has been a very long
day and maybe I'm starting to gone insane!

Thank you!

Gary

Mime
View raw message