|
GettingStarted
IntroductiondpHibernate is designed to quietly work behind the scenes and make everything as seamless as possible. However in order for us to do this we do need to know which objects we need to manage. This is done with the Managed metadata and a simple extends added to every value object/pojo class. Setup and ConfigurationBefore you start make sure you have followed the setup and configuration instructions defined here: Setup ActionscriptIn order for dpHibernate to be able to monitor the state of your objects and trigger the lazy loading as objects are touched. Two things need to be done to every value object in Action Script.
package model.beans
{
import mx.collections.ArrayCollection;
import net.digitalprimates.persistence.hibernate.HibernateBean;
[RemoteClass(alias="net.digitalprimates.samples.sample1.beans.User")]
[Managed]
public class User extends HibernateBean
{
public var id:String;
public var firstName:String;
public var lastName:String;
public var addresses:ArrayCollection;
public var connectInfo:UserConnectInfo;
}
}JavadpHibernate works by passing either the real object or a proxy back and forth with flex. For this reason the POJO's on the Java side, which will be returned by hibernate, need to be able to live as both a proxy and the full object.
|
3) Replace the regular mx:RemoteObject? with dp:HibernateRemoteObject?
ps. for all who are somewhat lost there are samples in the project svn repository
Managed? and extends HibernateBean?!?
The better is only a code annotated with Managed?.
Such a Plain ActionScript? Class
+)
AFAIK Blazeds does not support Managed? objects, its part of LCDS.
It appears that the Managed? designation mentioned here is implemented by the dpHibernate library.
Anybody has experience with this library and BlazeDS (not LCDS)? Is it useful for production website? I am wondering particulary Flex ArrayCollection? persistence mapping to database. Thank you.
there is no interface called "IHibernateBean", it may be wrong typed, and it should be "IHibernateProxy"
im trying to call method in "save" in userService but it is entering java service.
this.userService = new HibernateRemoteObject??(); this.userService.destination = "userService";
var call:AsyncToken?? = userService.save(user);
other method is like loadAll, remove, update is working but "save" is not entering in the service (java side). any idea?
thanks a lot. cheers.