From: James House <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [Xdoclet-user] Ordering of aggregate entities? (MORE) Date: Tue, 03 Jun 2003 11:24:52 -0600
I've found that the "valueobject.xdt" is specifying the tag <XDtEjbValueObj:concreteCollectionType/> as the type of set/collection that gets used for the aggregated members... Can anyone tell me how to change this from stamping in "HashSet" to stamping in "TreeSet"?
Thanks, james
James House wrote:
Thanks for the suggestions given thus far... but I'd rather not use JBossQL, and aside from that, I don't believe it would work because the value objects store the composed entities in a HashSet - which will screw up the order even if they are fetched in order.
I'm thinking that I could make the value objects "Comparable" and I can merge-in a compare() method with a "valueobject-custom.xdt" file. ... But then I still have the problem that the items are stored in a HashSet. Is there any way to get the generated value objects to use TreeSets instead of HashSets to hold the composed entities (actually, the composed value-objects)?
The only way I can think of is to make my own version of "valueobject.xdt" rather than using the one that comes with XDoclet, and have that version create TreeSet instances... but that doesn't excite me, as I'd like not to maintain my own version of xdoclet...
Any other ideas?
james
James House wrote:
Hi all,
I'm using CMP 2.0 and CMR to build some zippy EJBs.
I have one entity (Requisition) that has a composition of a send entiy (LineItem). I'm also using the @ejb.value-object feature of XDoclet 1.2 beta 2.
The line item entities have an "Id" field on them that is basically a sequential integer.
My question is: How can I get the set of line items returned so that they are ordered by their Id? (when I call requisition.getLineItems() which is shown below).
thanks, james
For interest, I'm using JBoss 3.2.1, and here's a snippet of my code that shows the relationship:
/** * This is a uni-directional one-to-many relationship CMR method * * @return a java.util.Set of related * com.partnet.rex.ejbi.LineItemLocal. * * @ejb.interface-method view-type="local" * * @ejb.relation * name="requisition-line_items" * role-name="requisition-has-line_items" * target-ejb="LineItem" * target-role-name="line_items-belong-to-a-requisition" * target-cascade-delete="yes" * * @ejb.value-object * compose="com.partnet.rex.vo.LineItem" * compose-name="LineItem" * members="com.partnet.rex.ejbi.LineItemLocal" * members-name="LineItem" * relation="external" * type="Set" * * @jboss.target-relation * fk_constraint="true" * fk-column="req_id" * related-pk-field="reqId" */ public abstract java.util.Set getLineItems();
------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus
------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
