W
William Zumwalt
I'm learning to work w/ DAO's and have this question. I'm trying to pull
my database code out of my entity and and make use of DAO's. My DAO
class is being generated from my entity by xdoclet, even though there's
not much in it.
I have the following in my entity bean ...
/**
* @ejb.create-method
*/
public String ejbCreate(String id, String desc) throws
ejbCreateException {
HashMap memento = new HashMap();
memento.put(SERIAL, serial = id);
memento.put(DESC, description = desc);
MyDAO.create(memento);
return serial;
}
My question is how do I define (in this case) a create() method of my
DAO which will look something like this (but hasn't been generated yet)
....
public abstract class MyDAO {
static public void create(HashMap data) throws PersistanceException {
CreateThing.getInstance().execute(data);
}
}
I saw the @dao.call, but not sure how to use it.
Any help much appreciated.
Will
my database code out of my entity and and make use of DAO's. My DAO
class is being generated from my entity by xdoclet, even though there's
not much in it.
I have the following in my entity bean ...
/**
* @ejb.create-method
*/
public String ejbCreate(String id, String desc) throws
ejbCreateException {
HashMap memento = new HashMap();
memento.put(SERIAL, serial = id);
memento.put(DESC, description = desc);
MyDAO.create(memento);
return serial;
}
My question is how do I define (in this case) a create() method of my
DAO which will look something like this (but hasn't been generated yet)
....
public abstract class MyDAO {
static public void create(HashMap data) throws PersistanceException {
CreateThing.getInstance().execute(data);
}
}
I saw the @dao.call, but not sure how to use it.
Any help much appreciated.
Will