Hi,
I make something for my project,
I create a class for make the link between the database and the application,
this class have methods who take in parameters a bean for make some criteria
and return a list.
In these methods, I use PB broker for make an Iterator and I pass the
iterator for make a List, I return that list.
Here is an example :
public List getList(ObjectView rsm) {
Iterator iterator = null;
ArrayList views = new ArrayList();
//Creation of criterias
Criteria criteria = new Criteria();
criteria.addEqualTo("kynoda", rsm.getNoda());
//Creation of the query
Query query = QueryFactory.newQuery(ObjectBO.class, criteria1);
//Call of the query and creation of the iterator
try {
broker.beginTransaction();
iterator = broker.getIteratorByQuery(query);
broker.commitTransaction();
} catch (Exception ex) {
log.error("Error : ", ex);
}
while (iterator.hasNext()) {
ObjectBO bo = (ObjectBO) iterator.next();
ObjectView view = new ObjectView();
PropertyUtils copieur = new PropertyUtils();
copieur.copyProperties(view, bo);
views.add(view);
}
//return of the list
return views;
}
Hope it can help.
Hi all,
I have simple model with Groups of Persons. ( 1-N ).
Groups has a Collection.
My question is simple is there a way to force ojb to use a standart
collection ( Vector or ArrayList ). My problem is that I want to use OJB
as a jboss service ( sar ), and I don-t want the client application to
be ojb dependent.
Thanks for comment.
ps: The only way I found is to implements writeObject ( serialisation )
and to replace obj collection by Vector during serialisation ...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]