[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nameForObject()?



hi

I need the opposite of org.ozoneDB.ExternalDatabase.objectForName(), is there something available? I could just store the string inside the database object, but that wouldn't be very efficient.

Background story:

I got one database object which points to another database object.
One object stores the proxy of the other by using the following:

class FirstObjectImpl extends OzoneRemote implements FirstObject {
	private transient SecondObject obj=null;
	private String objId;

	public FirstObjectImpl(SecondObject in_obj) {
		obj=in_obj;
		objId=in_obj.getId(); // how?
	}

	public getSecondObject() {
		if(obj==null)
			obj=db.objectForName(objId); // db is static
		return obj;
	}
}

Or maybe somebody has a better idea?

andy


-- 
Description forthcoming.