From: Gavin K. <Gav...@ex...> - 2002-12-31 06:14:24
|
> * Is there any chance to add predefined queries to the=20 > generated mapping? Ummm, I thought theres was a @hibernate.query tag > * Is there any chance to generate the bean-pattern=20 > (setXXX(), getXXX() > and especially the addXXX(Child)/setXXX(Parent)) methods of the > java-bean class? I really do not like to write them down... If you want that kind of thing, its probably better to go with CodeGenerator rather than XDoclet. Hibernate is stubbornly "property-centric" rather than "field-centric" and most people think this is a feature. It would cut against the grain to let you mark up persistent fields and have the get/set pair be generated. (Anyway, I just let Eclipse generate my get/set pair.) ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Konstantin P. <kpr...@ya...> - 2002-12-31 14:25:33
|
> Of course - I momentarily forgot that XDoclet > augments the > actually used class... sorry .) (the reason it put > me of is that > you said parallel hierachies, as if the two classes > was not related - they > are, the one is Base and the other is Concrete, that > is not parallel - just > 2 times the classes you probably need .) Anyway, using xdoclet for generating getters/setters is an overkill. In Hibernate context follwing parts of xdoclet would be usefull: - java bean module -> generate your beaninfo for hibernated classes ( in EJB scenario it has to be tweaked for value/data objects -> stinks ). This way you get instantly swing/webwork support - generate smart remote proxies for hibernated classes, for example something like home interfaces of entities - generate all the stuff that makes going to datastore through session bean transparent... > Yes - the work with XDoclet and the maturing of the > CodeGenerator makes > Hibernate's surrounding tools very worth while :) > One can either go from source to descriptor or from > descriptor to source > depending on which scenario you got - and via > XDocLet, CodeGenerator (and > possible MiddleGen) we could same some very precious > developer time :) There is another tool I would like to play with: UML2EJB ( also from xdoclet neighbourhood ) - get you .xmi and produce xdoclet-marked ejb sources. Matthias asked me to write templates for hibernated classes ( also xdoclet marked ) regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: Max R. A. <ma...@eo...> - 2002-12-31 14:49:27
|
> > Anyway, using xdoclet for generating getters/setters > is an overkill. Roger :) > In Hibernate context follwing parts of xdoclet would > be usefull: > - java bean module -> generate your beaninfo > for hibernated classes ( in EJB scenario it has to be > tweaked for value/data objects -> stinks ). > This way you get instantly swing/webwork support I've long sought for an example where BeanInfo classes could be used for something usefull (and Visual Age is not one of them)... Do you have an example of this ? Is it some kind of databinding you are doing or ? > - generate smart remote proxies for hibernated > classes, for example something like home interfaces of > entities > - generate all the stuff that makes going to > datastore through session bean transparent... Is this reality now or "just thoughts" ? (I would really like to work with this one (and we are about to hit a point where the codegenerator and XDoclet module may possible overlap :) > > Yes - the work with XDoclet and the maturing of the > > CodeGenerator makes > > Hibernate's surrounding tools very worth while :) > > One can either go from source to descriptor or from > > descriptor to source > > depending on which scenario you got - and via > > XDocLet, CodeGenerator (and > > possible MiddleGen) we could same some very precious > > developer time :) > > There is another tool I would like to play with: > UML2EJB ( also from xdoclet neighbourhood ) - > get you .xmi and produce xdoclet-marked ejb sources. > Matthias asked me to write templates for hibernated > classes ( also xdoclet marked ) > What is that compared to e.g. http://sourceforge.net/projects/axgen (which our old OJB friends has support for ..) > regards, > > ===== > Konstantin Priblouda ( ko5tik ) Freelance Software developer > < http://www.pribluda.de > < play java games -> http://www.yook.de > > < render charts online -> http://www.pribluda.de/povray/ > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Konstantin P. <kpr...@ya...> - 2002-12-31 15:42:01
|
> I've long sought for an example where BeanInfo > classes could > be used for something usefull (and Visual Age is not > one of them)... > Do you have an example of this ? Is it some kind of > databinding you > are doing or ? Well, Say I have ejb backend with shitload of entities, and swing client for doing just CRUD ( create customer, worker, transportation means, payment modalities or whatever ) I have a lot of properties and a lot of editors panels to develop. This suks. So what I'm doing: 1. Tag my entity beans that xdoclet generates beaninfo for data objects, also specify custom editors ( and write them ) for all usefull data types I have - monetary amount, selection fo ejb entity or whatever. 2. Write generic bean editor class, which can be fed with object and beaninfo for this ( or can resolve beaninfo itself ), and does reflection to update all the fields from propertyx editors. It also produces proper property editor on request. 3. Then not so generic editor panel, which setup this beaneditor, feeds it with beaninfo, and then pulls all the property editors from there, get their swing components and rigs up interface ( only custom step for entity ) It listens on changes of bean editor, activates buttons for save/update/delete etc. > > - generate smart remote proxies for hibernated > > classes, for example something like home > interfaces of > > entities > > - generate all the stuff that makes going to > > datastore through session bean transparent... > > Is this reality now or "just thoughts" ? (I would > really like to work with > this one (and we are about to hit a point where the > codegenerator and > XDoclet module may possible overlap :) Well, this is reality for EJB stuff. Though not completely adopet by xdoclet :) ( even commiter can not do everything he likes :) ) I developed following: 1. Facade session bean for entity, which provides access to finders, but returns collections of data/value objects instead of remote interfaces. 2. Static remote facade class for this session, which isolates you from such nice tasks like jndi lookups or whatever. 3. Observable collections transparently proxying methods on session facade, which are observiong CRUD adapters. In my swing app I just hook up to those collections with my data models ( tree, combo , table ), and route entity creation/remova/update through designated CRUD adapter which signals collections that they shall reload changes. > What is that compared to e.g. > http://sourceforge.net/projects/axgen (which > our old OJB friends has support for ..) must look at it. now I'm fighting with inheriting ID properties ( look in forum :) ), and damn things are just not loaded, though found... regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: Gavin K. <Gav...@ex...> - 2003-01-01 22:47:18
|
I agree with all this. Writing get/set pairs is not that painful. > -----Original Message----- > From: Konstantin Priblouda [mailto:kpr...@ya...]=20 > Sent: Wednesday, 1 January 2003 12:36 AM > To: Max Rydahl Andersen > Cc: hibernate-devel > Subject: Re: [Hibernate] Hibernate XDoclet Task >=20 >=20 >=20 > > Just corius, why does generating add, set, get for > > the hibernate beans makes > > you loose any advantage ? (Where is there created a > > prallel class > > hierarchy?) >=20 > XDoclet works like this: > - grab source class tagged with tags > - generate something out of it.=20 >=20 > So, say you have base class without getters etc, > but with properties. You can {theoretically,=20 > since no tags or templates exists for this puprose } > tag properties appropriately. Then you can generate > source for real one class with getters / setters > ( derived from base one ) -> you got 2 classes & > you have to work with new one.=20 >=20 > What I like inhibernate is the ability just > write my persistent classes , and work wit them.=20 > Not like entity beans with all those interfaces > & utility stuff. Though we might be generation some > utility stuff by xdoclet - like remote facades & crud > adapetrs for going to hibernate through session bean. >=20 > It simply does not pays to use xdoclet for generation > of getters/setters. Every decent IDE will yllow > you to do this.=20 >=20 > But when it comes to generation of shitload of XML > descriptors - xdoclet comes to full strength... >=20 > regards, >=20 > =3D=3D=3D=3D=3D > Konstantin Priblouda ( ko5tik ) Freelance Software developer > < http://www.pribluda.de > < play java games ->=20 http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list hib...@li... https://lists.sourceforge.net/lists/listinfo/hibernate-devel ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Konstantin P. <kpr...@ya...> - 2002-12-31 11:01:56
|
--- Gavin King <Gav...@ex...> wrote: > > > * Is there any chance to add predefined queries > to the > > generated mapping? > > Ummm, I thought theres was a @hibernate.query tag > > > * Is there any chance to generate the > bean-pattern > > (setXXX(), getXXX() > > and especially the > addXXX(Child)/setXXX(Parent)) methods of the > > java-bean class? I really do not like to write > them down... Yes, xdoclet can be tricked to do this. But this feature is not implemented - though nobody prevents you from hacking templates. But it seems to be not very usefull for me. XDoclet can generate derived class for you, and all kinds of methods in this class. But this way you would lose main advantage of using hibernate vs entity beans - to get rid of paralel class hierarchies... > (Anyway, I just let Eclipse generate my get/set > pair.) I do this with jEdit. Just wrote small velocity template... regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: Max R. A. <ma...@eo...> - 2002-12-31 13:20:40
|
> > > * Is there any chance to add predefined queries > > to the > > > generated mapping? > > > > Ummm, I thought theres was a @hibernate.query tag > > > > > * Is there any chance to generate the > > bean-pattern > > > (setXXX(), getXXX() > > > and especially the > > addXXX(Child)/setXXX(Parent)) methods of the > > > java-bean class? I really do not like to write > > them down... > > Yes, xdoclet can be tricked to do this. But this > feature is not implemented - though nobody prevents > you from hacking templates. > But it seems to be not very usefull for me. > XDoclet can generate derived class for you, and > all kinds of methods in this class. But this way you > would lose main advantage of using hibernate vs entity > beans - to get rid of paralel class hierarchies... Just corius, why does generating add, set, get for the hibernate beans makes you loose any advantage ? (Where is there created a prallel class hierarchy?) /max |
From: Konstantin P. <kpr...@ya...> - 2002-12-31 13:35:57
|
> Just corius, why does generating add, set, get for > the hibernate beans makes > you loose any advantage ? (Where is there created a > prallel class > hierarchy?) XDoclet works like this: - grab source class tagged with tags - generate something out of it. So, say you have base class without getters etc, but with properties. You can {theoretically, since no tags or templates exists for this puprose } tag properties appropriately. Then you can generate source for real one class with getters / setters ( derived from base one ) -> you got 2 classes & you have to work with new one. What I like inhibernate is the ability just write my persistent classes , and work wit them. Not like entity beans with all those interfaces & utility stuff. Though we might be generation some utility stuff by xdoclet - like remote facades & crud adapetrs for going to hibernate through session bean. It simply does not pays to use xdoclet for generation of getters/setters. Every decent IDE will yllow you to do this. But when it comes to generation of shitload of XML descriptors - xdoclet comes to full strength... regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |