User: pazu Date: 02/05/03 09:36:38 Modified: modules/ejb/src/xdoclet/modules/ejb/entity/resources Tag: MODULE_REFACTORING_BRANCH entity-value.j Log: Fixed a bug where the internal VO was being invalidated too early. Would lead to NPE's on an entity with more than one aggregate/compose. Also changed the throws clause of some methods. Now addValue() methods throws CreateException for composes and FinderException for aggregates. updateValue() methods now throws FinderException for aggregates. Revision Changes Path No revision No revision 1.1.2.2 +23 -9 xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value.j Index: entity-value.j =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value.j,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -w -r1.1.2.1 -r1.1.2.2 --- entity-value.j 27 Apr 2002 21:09:07 -0000 1.1.2.1 +++ entity-value.j 3 May 2002 16:36:37 -0000 1.1.2.2 @@ -13,7 +13,12 @@ <XDtEjbValueObj:forAllRelations superclasses="true" valueobject="<XDtEjbValueObj:valueObjectMatch/>"> <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="type"> public void add<XDtMethod:methodTagValue tagName="ejb:value-object" paramName="members-name"/>(<XDtEjbValueObj:currentAggregateType/> added) + <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="compose"> throws javax.ejb.CreateException + </XDtMethod:ifHasMethodTag> + <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="aggregate"> + throws javax.ejb.FinderException + </XDtMethod:ifHasMethodTag> { try { @@ -38,8 +43,14 @@ <XDtMethod:methodName/>().add(relation); } catch (Exception e){ + <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="compose"> if (e instanceof javax.ejb.CreateException) throw (javax.ejb.CreateException)e; + </XDtMethod:ifHasMethodTag> + <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="aggregate"> + if (e instanceof javax.ejb.FinderException) + throw (javax.ejb.FinderException)e; + </XDtMethod:ifHasMethodTag> else throw new javax.ejb.EJBException(e); } @@ -78,6 +89,7 @@ <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="compose"> public void update<XDtMethod:methodTagValue tagName="ejb:value-object" paramName="members-name"/>(<XDtEjbValueObj:currentAggregateType/> updated) + throws javax.ejb.FinderException { try { @@ -97,6 +109,9 @@ relation.set<XDtEjbValueObj:currentAggregateType short="true"/>(updated); } catch (Exception e){ + if (e instanceof javax.ejb.FinderException) + throw (javax.ejb.FinderException)e; + else throw new javax.ejb.EJBException(e); } } @@ -193,13 +208,6 @@ <XDtEjbValueObj:currentAggregateType/> o = (<XDtEjbValueObj:currentAggregateType/>)i<XDtEjbValueObj:currentAggregateName/>.next(); remove<XDtMethod:methodTagValue tagName="ejb:value-object" paramName="members-name"/>(o); } - -<XDtComment:comment> -Invalidates the internal VO object to force reloading from the -the database the next time the VO is obtained -TODO : think more about it ;) -</XDtComment:comment> - this.<XDtEjbValueObj:currentValueObjectAttribute/> = null; </XDtMethod:ifHasMethodTag> } </XDtEjbValueObj:forAllAggregates> @@ -257,6 +265,12 @@ { throw new javax.ejb.EJBException(e); } + <XDtComment:comment> + Invalidates the internal VO object to force reloading from the + the database the next time the VO is obtained + TODO : think more about it ;) + </XDtComment:comment> + this.<XDtEjbValueObj:currentValueObjectAttribute/> = null; } </XDtEjbValueObj:forAllSuperSetValue>
_______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel