Re: newbie q #2: how to use value objects?
Eivind Waaler <[email protected]>
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 21 Oct 2003, Eivind Waaler wrote: > Hi Mike. > > I suggest you try obtaining the VALUEOBJECT_REFACTORING_BRANCH from the > Middlegen cvs. This has been modified with support for value objects and > session bean facades. It is by far a perfect implementation of value Hmm, this could get misunderstood. I meant far from perfect.. Tired in the morning.. :-) .eivind > object support, but might take you a step further.. > > I'd be interested in any changes or suggestions you would have in this :-) > > CVS info here: > http://sourceforge.net/cvs/?group_id=36044 > > Let me know if you have any problems.. > > .eivind > > On Sat, 18 Oct 2003, Michael Harm wrote: > > > Hi again. > > > > I've been using dataobjects with middlegen/ejbdoclet (jboss 3.2.1, > > oracle 9i), but I find that often in my session beans I'd like to be > > able to optionally stick in references to other data objects that have > > an fk relationship to my object. For instance, if a Person bean has a > > set of related Address beans, I'd like it to not only have the field in > > AddressData for the person pk, but also a PersonData member. When I > > need to slap that in, I can, (thereby making a 'heavy' dataobject), or > > optionally not (for a 'light' one). > > > > Value objects in xdoclet/ejbdoclet seem the thing to use. But I'm > > having a hard time integrating the standard middlegen stuff with that. > > ejbdoclet wants @ejb.value-object tags in the comments for cmr fields > > to create the objects; otherwise I just get the column fields and > > that's no better than what the dataobject guy gives me. But middlegen > > doesn't seem to want to create these tags for the cmr objects (like, in > > the comments above the generated 'getFooByBarId' things in the entity > > bean). I can make merged files for the column field accessors, but it > > doesn't end up in the object reference accessors like 'getFooByBarId'. > > I tried hacking the velocity template to stick 'em in there, and told > > the valueobject directive in ejbdoclet to suffix them with "Data" and > > not "Value", and that compiles, but the resultant value objects have > > references to Local beans, not other value objects. In other words, my > > AddressData guy has members like PersonLocal, not PersonData. Which > > means I can't use them outside a transaction context, which is the > > whole reason I want to use value/data objects in the first place. > > > > So there's probably something very simple that I'm missing here. > > > > I understand that the whole value object thing is undergoing a major > > refactoring, and there's an effort to replace dataobjects with > > valueobjects entirely. What's the status of that? Is there a pointer > > to info about it? The user mailing list has only a couple references > > to it. Is that the animal I want to be looking at? Should I check out > > that branch in cvs, or is it still undergoing major development? > > > > Or should I just try my hand at butchering xdoclet's template for data > > objects to make it also include private fields, getters and setters for > > referenced objects (like PersonData in the example above), and call it > > a day? Pretend that I never heard about value objects, and instead > > have it generate extended data objects? > > > > Thanks for any info! > > > > cheers, > > > > Mike Harm > > > > > > > > > > ------------------------------------------------------- > > This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo > > The Event For Linux Datacenter Solutions & Strategies in The Enterprise > > Linux in the Boardroom; in the Front Office; & in the Server Room > > http://www.enterpriselinuxforum.com > > _______________________________________________ > > middlegen-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by OSDN developer relations > Here's your chance to show off your extensive product knowledge > We want to know what you know. Tell us and you have a chance to win $100 > http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 > _______________________________________________ > middlegen-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/middlegen-user > ------------------------------------------------------- This SF.net email is sponsored by OSDN developer relations Here's your chance to show off your extensive product knowledge We want to know what you know. Tell us and you have a chance to win $100 http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54