You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
(157) |
Mar
(111) |
Apr
(61) |
May
(68) |
Jun
(45) |
Jul
(101) |
Aug
(132) |
Sep
(148) |
Oct
(227) |
Nov
(141) |
Dec
(285) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(518) |
Feb
(462) |
Mar
(390) |
Apr
(488) |
May
(321) |
Jun
(336) |
Jul
(268) |
Aug
(374) |
Sep
(211) |
Oct
(246) |
Nov
(239) |
Dec
(173) |
2004 |
Jan
(110) |
Feb
(131) |
Mar
(85) |
Apr
(120) |
May
(82) |
Jun
(101) |
Jul
(54) |
Aug
(65) |
Sep
(94) |
Oct
(51) |
Nov
(56) |
Dec
(168) |
2005 |
Jan
(146) |
Feb
(98) |
Mar
(75) |
Apr
(118) |
May
(85) |
Jun
(75) |
Jul
(44) |
Aug
(94) |
Sep
(70) |
Oct
(84) |
Nov
(115) |
Dec
(52) |
2006 |
Jan
(113) |
Feb
(83) |
Mar
(217) |
Apr
(158) |
May
(219) |
Jun
(218) |
Jul
(189) |
Aug
(39) |
Sep
(3) |
Oct
(7) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(3) |
Jun
(8) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
|
2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gavin K. <Gav...@ex...> - 2002-12-30 01:46:29
|
Well, its probably best to implement equals() and hashCode() if you plan on keeping it in a Set. But since Hibernate guarantees =3D=3D is preserved for objects in the same Session, even thats not vital, as long as you are carefull not to mix and match objects from different sessions. And its up to you to decide whether you should=20 use primary key values of property values to determine equality.=20 So basically theres nothing specific to Hibernate in your decision=20 to implement equals() or hashCode(). Usually I don't bother. On the other hand, you *must* implement equals() and hashCode() for: * a composite-id class * a persistent class with an "embedded" composite-id > Is it recommended that all hibernate persistent classes implement > equals() and hashcode()? If so, is it possible to implement=20 > them in a base class? I'm doing this write now with the=20 > following toString() method and it works pretty well: >=20 > public String toString() { > StringBuffer results =3D new StringBuffer(); > Class clazz =3D getClass(); >=20 > results.append(getClass().getName() + "\n"); >=20 > Field[] fields =3D clazz.getDeclaredFields(); >=20 > try { > AccessibleObject.setAccessible(fields, true); >=20 > for (int i =3D 0; i < fields.length; i++) { > results.append("\t" + fields[i].getName() + "=3D" + > fields[i].get(this) + "\n"); > } > } catch (Exception e) { > // ignored! > } >=20 > return results.toString(); > } >=20 > Thanks, >=20 > Matt >=20 > > -----Original Message----- > > From: hib...@li... > > [mailto:hib...@li...] On=20 > > Behalf Of Gavin King > > Sent: Sunday, December 29, 2002 4:09 AM > > To: hib...@li... > > Subject: [Hibernate] CodeGenerator > >=20 > >=20 > >=20 > > Hi everyone, > >=20 > > I spent some time earlier today playing around with > > CodeGenerator (a part of the codebase that I'm only=20 > > barely familiar with) and made some improvements. > >=20 > > * The support for <composite-id> is now working > > properly with composite id classes having > > correctly generated hashCode() and equals() > > methods. > >=20 > > * All generated classes now implement toString() > >=20 > > The generated classes now have a dependency upon=20 > commons-lang, which=20 > > doesn't bother me in the slightest, but other people may=20 > have another > > opinion. > >=20 > > The last thing I noticed, but didn't have time > > to fix, is that subclass constructors are unaware > > of superclass properties. We need to fix that > > as soon as possible. If anyone has a chance to > > address this, I would appreciate it. > >=20 > > 1.2.1 should be released before the weekend. > >=20 > > peace > >=20 > > Gavin > >=20 > >=20 > > ********** CAUTION - Disclaimer ********** > > This message may contain privileged and confidential > > information. If you are not the intended recipient of this=20 > > message (or responsible for delivery of the message to such=20 > > person) you are hereby notified that any use, dissemination,=20 > > distribution or reproduction of this message is prohibited.=20 > > If you have received this message in error, you should=20 > > destroy it and kindly notify the sender by reply e-mail.=20 > > Please advise immediately if you or your employer do not=20 > > consent to Internet e-mail for messages of this kind.=20 > > Opinions, conclusions and other information in this message=20 > > that do not relate to the official business of Expert=20 > > Information Services Pty Ltd ("The Company") shall be=20 > > understood as neither given nor endorsed by it. > >=20 > > The Company advises that this e-mail and any attached > > files should be scanned to detect viruses. The Company accepts no=20 > > liability for loss or damage (whether caused by negligence or not)=20 > > resulting from the use of any attached files. > > **EIS******** End of Disclaimer ********** > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > 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 > >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > 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 >=20 |
From: Max R. A. <ma...@eo...> - 2002-12-29 23:47:15
|
Here I sit with a patch for the codegenerator and know sourceforge is down for maintanence - bummer! Well, you get it here as an attachment instead then, so I can go happily to bed :) Yappering starts here: This patch solves the problems regarding the subclass not knowing about the supers fields. It does now. This patch both cleans up some parts of the codegen, but also makes it obvious that it could be even cleaner :) I suggest we just use this patch for 1.2.1 (it its better than the current one), and when we (read: Gavin) decides to integrate the metattribute patch (or not) - Then I'll do some major cleaning up in the codegenerator. (note to Gavin, if you accept the idea about metaattribute's then do not apply my earlier posted metaattriubte patch! I'll like to do the refactoring and metaattribute in one go ...and besides the old patch will not work without some work when this one gets applied :) Changes made: Made some small (non-vital) changes to the codegen test.hbm.xml files to make them more test friendly (e.g. all classes will know end in codegen.test instead of default package as some did before) Removed the adding of the implementing class name for collections as the codegenerator does not generate code that refer to this class (It is only used in the initialisation field of Field - and this field is never accessed from the BasicRender (or anywhere else that matters)) (Primarily done to avoid being told by Eclipse that I have unused imports in my code :) Refactored constructor generation so it is (much) cleaner and simpler (Primarily done to make it easier to add support for superclasses fields in constructors of subclasses) Discovered "bug" regarding the constructor arguments referencing to the concrete types instead of their proxy/interface. Came to think: Is the current behavior correct ? Should get/sets method for e.g. User use the interface IUser or the concrete User ? While refactoring it became obvious that the class ClassName and its usage could need another good old refactoring - but that i'll do later. |
From: Juozas B. <ba...@ce...> - 2002-12-29 19:54:51
|
equals() and hashCode() can be implemented using this definition : for all persistent objects a, b : a.equals(a) === true a.equals(b) ==> b.equals(a) a.equals(b) ==> a.hashCode() = b.hashCode() a is persistent ==> a.getId() != null a.equals(b) <=> a.getId().equals(b.getId()) a is persistent ==> a.hashCode() = a.getId().hashCode() > > > > > This is more or less what commons-lang's reflectionToString > > does (which is what Gavin's patch will make the CodeGenerator do now) > > > > But what about your hashCode ? > > > > /max > > > > I'm looking for advice on how to implement an equals() and hashCode() > method in my base class. Any suggestions are appreciated. > > Thanks, > > Matt > > > > > ------------------------------------------------------- > 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: Max R. A. <ma...@eo...> - 2002-12-29 17:21:54
|
> >The generated classes now have a dependency upon > >commons-lang, which doesn't bother me in the > >slightest, but other people may have another > >opinion. > > Yes - me for one :) I would like to keep the generated code > as simple as possible :) (but at the same time I like to broaden > the usage of commons-lang) > > Thus, I'll suggest (and also make a patch as I get to it) that > it should be optional to have the dependency on commons-lang. > Optimal, we could generate a bare-boned toString method based > on the attributes/properties know to the metadata. > On second thought - I'll add an option to either have the codegenerator use the methods provided by commons-lang OR not do anything at all :) The "do nothing" option is for those who want to have either a base or their own custom subclass for their classes (nicely supported by my metaattribute patch :) > >The last thing I noticed, but didn't have time > >to fix, is that subclass constructors are unaware > >of superclass properties. We need to fix that > >as soon as possible. If anyone has a chance to > >address this, I would appreciate it. > > I'll look into it. This one is more "challenging" than I thought - will take some fiddling and refactoring to do it properly....working on it (and also on making the codegen test hbm.xml files more complete/test-friendly) > And what about the meta-attribute thingy ? (it is not that a big > codechange compared to the recent commit :) (i'm just pushing here :) How about adding the meta-attribute thingy as an extra X-mas gift - it would instantly make me happy, and the codegenerator so much more better :) /max |
From: Max R. A. <ma...@eo...> - 2002-12-29 16:03:36
|
Best and easiest advice is: Use commons-lang ;) http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/builder/H ashCodeBuilder.html and http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/builder/T oStringBuilder.html Regarding hashCode write your own following the guidelines written here: (which is what commons-lang has done) http://java.sun.com/docs/books/effective/chapters.html (Read Chapter 3) /max ----- Original Message ----- From: "Matt Raible" <ma...@ra...> To: <hib...@li...> Sent: Sunday, December 29, 2002 4:47 PM Subject: RE: [Hibernate] CodeGenerator > > > > > This is more or less what commons-lang's reflectionToString > > does (which is what Gavin's patch will make the CodeGenerator do now) > > > > But what about your hashCode ? > > > > /max > > > > I'm looking for advice on how to implement an equals() and hashCode() > method in my base class. Any suggestions are appreciated. > > Thanks, > > Matt > > > > > ------------------------------------------------------- > 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: Matt R. <ma...@ra...> - 2002-12-29 15:47:29
|
> > This is more or less what commons-lang's reflectionToString > does (which is what Gavin's patch will make the CodeGenerator do now) > > But what about your hashCode ? > > /max > I'm looking for advice on how to implement an equals() and hashCode() method in my base class. Any suggestions are appreciated. Thanks, Matt |
From: Max R. A. <ma...@eo...> - 2002-12-29 15:35:54
|
> Is it recommended that all hibernate persistent classes implement > equals() and hashcode()? It is always recommende to implement equals and hashCode for any class that you would consider putting into java collections or other mechanisms that tries to identity and/or sort them....so yes, it is recommende for all persistent classes (hibernate or no hibernate :) > If so, is it possible to implement them in a > base class? Yes - that is possible, but the current codegenerator (and Hibernate by design) refrain from forcing you to have an baseclass for your persistent classes. I've committed a patch (my so called metaattribute patch) that would allow the codegenerator to seamingsly (and more easily) support such constructs as common baseclasses and other fancy stuff (which should not be required by the "basic" codegeneration) > I'm doing this write now with the following toString() > method and it works pretty well: > > public String toString() { > StringBuffer results = new StringBuffer(); > Class clazz = getClass(); > > results.append(getClass().getName() + "\n"); > > Field[] fields = clazz.getDeclaredFields(); > > try { > AccessibleObject.setAccessible(fields, true); > > for (int i = 0; i < fields.length; i++) { > results.append("\t" + fields[i].getName() + "=" + > fields[i].get(this) + "\n"); > } > } catch (Exception e) { > // ignored! > } > > return results.toString(); > } This is more or less what commons-lang's reflectionToString does (which is what Gavin's patch will make the CodeGenerator do now) But what about your hashCode ? /max |
From: Matt R. <ma...@ra...> - 2002-12-29 12:17:21
|
Is it recommended that all hibernate persistent classes implement equals() and hashcode()? If so, is it possible to implement them in a base class? I'm doing this write now with the following toString() method and it works pretty well: public String toString() { StringBuffer results = new StringBuffer(); Class clazz = getClass(); results.append(getClass().getName() + "\n"); Field[] fields = clazz.getDeclaredFields(); try { AccessibleObject.setAccessible(fields, true); for (int i = 0; i < fields.length; i++) { results.append("\t" + fields[i].getName() + "=" + fields[i].get(this) + "\n"); } } catch (Exception e) { // ignored! } return results.toString(); } Thanks, Matt > -----Original Message----- > From: hib...@li... > [mailto:hib...@li...] On > Behalf Of Gavin King > Sent: Sunday, December 29, 2002 4:09 AM > To: hib...@li... > Subject: [Hibernate] CodeGenerator > > > > Hi everyone, > > I spent some time earlier today playing around with > CodeGenerator (a part of the codebase that I'm only > barely familiar with) and made some improvements. > > * The support for <composite-id> is now working > properly with composite id classes having > correctly generated hashCode() and equals() > methods. > > * All generated classes now implement toString() > > The generated classes now have a dependency upon > commons-lang, which doesn't bother me in the > slightest, but other people may have another > opinion. > > The last thing I noticed, but didn't have time > to fix, is that subclass constructors are unaware > of superclass properties. We need to fix that > as soon as possible. If anyone has a chance to > address this, I would appreciate it. > > 1.2.1 should be released before the weekend. > > peace > > Gavin > > > ********** 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 ********** > > > > ------------------------------------------------------- > 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: Max R. A. <ma...@eo...> - 2002-12-29 12:15:44
|
>The generated classes now have a dependency upon >commons-lang, which doesn't bother me in the >slightest, but other people may have another >opinion. Yes - me for one :) I would like to keep the generated code as simple as possible :) (but at the same time I like to broaden the usage of commons-lang) Thus, I'll suggest (and also make a patch as I get to it) that it should be optional to have the dependency on commons-lang. Optimal, we could generate a bare-boned toString method based on the attributes/properties know to the metadata. >The last thing I noticed, but didn't have time >to fix, is that subclass constructors are unaware >of superclass properties. We need to fix that >as soon as possible. If anyone has a chance to >address this, I would appreciate it. I'll look into it. >1.2.1 should be released before the weekend. And what about the meta-attribute thingy ? (it is not that a big codechange compared to the recent commit :) (i'm just pushing here :) /max |
From: Gavin K. <Gav...@ex...> - 2002-12-29 11:09:01
|
Hi everyone, I spent some time earlier today playing around with=20 CodeGenerator (a part of the codebase that I'm only=20 barely familiar with) and made some improvements. * The support for <composite-id> is now working properly with composite id classes having correctly generated hashCode() and equals() methods. * All generated classes now implement toString() The generated classes now have a dependency upon commons-lang, which doesn't bother me in the slightest, but other people may have another opinion. The last thing I noticed, but didn't have time to fix, is that subclass constructors are unaware of superclass properties. We need to fix that as soon as possible. If anyone has a chance to address this, I would appreciate it. 1.2.1 should be released before the weekend. peace Gavin ********** 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: <no...@so...> - 2002-12-29 00:39:44
|
Bugs item #659534, was opened at 2002-12-28 16:39 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428708&aid=659534&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mark Woon (unkyaku) Assigned to: Nobody/Anonymous (nobody) Summary: build.xml is broken Initial Comment: build.xml is broken since todo.txt has been removed from CVS. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428708&aid=659534&group_id=40712 |
From: <no...@so...> - 2002-12-28 11:02:16
|
Feature Requests item #650588, was opened at 2002-12-08 23:40 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=650588&group_id=40712 Category: None Group: None Status: Closed Priority: 4 Submitted By: Gavin King (oneovthafew) Assigned to: Nobody/Anonymous (nobody) Summary: Logging of JDBC parameters Initial Comment: A couple of people have asked to be able to see the actual values written to JDBC "?" parameters in the log. ---------------------------------------------------------------------- >Comment By: Max R. Andersen (maxcsaucdk) Date: 2002-12-28 12:02 Message: Logged In: YES user_id=18119 Done what ? :) Added logging of parameters at the Hibernate level or via P6Spy ? (couldn't find any of it in the cvs - probably just me who is blind :) ) ---------------------------------------------------------------------- Comment By: Gavin King (oneovthafew) Date: 2002-12-28 05:31 Message: Logged In: YES user_id=384580 Done. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2002-12-23 00:09 Message: Logged In: YES user_id=18119 A tool like p6spy could solve this issue transparently at the JDBC level. Maybe just mention that in the docs until we get better logging ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=650588&group_id=40712 |
From: Matt R. <ma...@ra...> - 2002-12-28 10:03:14
|
unsaved-value="null" worked like a charm - thanks ;-) I actually got that answer off the FAQ this morning - nice doco! Matt > -----Original Message----- > From: Gavin King [mailto:Gav...@ex...] > Sent: Friday, December 27, 2002 9:19 PM > To: Matt Raible; hib...@li... > Subject: RE: [Hibernate] saveOrUpdate vs. update > > > Ummm theres a bunch of things to get right and since I can't > see your mappings, I'm not sure which. However, you should > check out the functionality of: > > * unsaved-value attribute of <id> > * cascade attribute of associations > * lazy attribute of collections > * proxy attribute of <class>, <subclass>, <joined-subclass> > > by fiddling with those I think all your problems will go away ;) > > -----Original Message----- > From: Matt Raible [mailto:ma...@ra...] > Sent: Friday, 27 December 2002 7:34 PM > To: hib...@li... > Subject: [Hibernate] saveOrUpdate vs. update > > > I have a BaseDAO that contains some generic (I think) > Hibernate compatible code. It's basically removeObject, > storeObject, and retrieveObject. I've found that Hibernate > tries to do an INSERT if I use sess.saveOrUpdate in the > following method: > protected void storeObject(Object obj) throws DAOException > { > Session ses = null; > try { > ses = sessionFactory.openSession(); > ses.saveOrUpdate(obj); > ses.flush(); > ses.connection().commit(); > } catch (Exception e) { > try { > ses.connection().rollback(); > } catch (Exception ex) { > e.printStackTrace(); > } > ; > throw new DAOException(e); > } finally { > try { > ses.close(); > } catch (Exception ex) { > ex.printStackTrace(); > } > ; > } > } > This causes an error, as there is already a user with this > name. So I tried changing it to just ses.update(obj), but > now I'm getting the following error: > [junit] Testcase: > testAddResume(org.appfuse.persistence.UserDAOTest): Caused an > ERROR > [junit] cirrus.hibernate.HibernateException: The given > object has a null identifier property [org.appfuse.persistenc > e.Resume] > [junit] org.appfuse.persistence.DAOException: > cirrus.hibernate.HibernateException: The given object has a > null ident ifier property [org.appfuse.persistence.Resume] > [junit] at > org.appfuse.persistence.BaseDAOHibernate.storeObject(BaseDAOHi > bernate.ja > va:117) > [junit] at > org.appfuse.persistence.UserDAOHibernate.addResume(UserDAOHibe > rnate.java > :117) > [junit] at > org.appfuse.persistence.UserDAOTest.testAddResume(UserDAOTest. > java:91) > > > All I'm trying to do is the following: > user = dao.getUser("tomcat"); > user.setAddress("new address"); > User savedUser = dao.saveUser(user); > assertEquals(savedUser.getAddress(), user.getAddress()); > But it seems to be trying to go and persist the children - > can I turn this off? Also, I've noticed that my user's > children are retrieved when I get the user's information. > Does this mean that if I create a bunch of mappings from user > to other entities, that they're all going to be loaded when I > get a user's information? This might not be desirable since > I get a user's information when they login, and if they have > a whole bunch of records associated with their name... you > get the idea... Thanks, > Matt > > > ********** 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: Pablo I. L. <pi...@gm...> - 2002-12-28 06:51:26
|
Here are the templates with the changes I've done to them so Hibernate XDoclet module support some "inheritable" tags as Ara suggested. See changes.txt for list of changes and some notes. This is working so far for me now, but it is NOT well tested. Friday, December 27, 2002, 6:33:36 AM, escribiste: KP> --- Gavin King <Gav...@ex...> wrote: >> >> This is a known limitation of the current Hibernate >> XDoclet >> module. Now, I think XDoclet can support remote >> methods defined >> on superclasses in its ejb module, so it must be >> possible to >> add support for persistent properties defined on >> superclasses >> to the Hibernate module. >> >> Anyone know how to attack this problem? KP> This module is merely 2 weeks old, and in no way KP> mature. Maybe not even alpha :) You are welcome to KP> make KP> proposal how it could be made better. KP> I know a lot over xdoclet stuff ( and I'm somehow in KP> charge of developing this module ), but not a lot KP> about hibernate ( I'm learning ) KP> I suggest you to add enhancement issue into JIRA KP> ( xdoclet bug/feature tracking system): KP> http://opensource.atlassian.com/projects/xdoclet/secure/Dashboard.jspa KP> BTW Gavin, it's better than sourceforge one, KP> and atlassian people are hosting open source projects KP> for free. KP> regards, KP> ===== KP> Konstantin Priblouda ( ko5tik ) Freelance Software developer KP> < http://www.pribluda.de > < play java games -> http://www.yook.de > KP> < render charts online -> http://www.pribluda.de/povray/ > KP> __________________________________________________ KP> Do you Yahoo!? KP> Yahoo! Mail Plus - Powerful. Affordable. Sign up now. KP> http://mailplus.yahoo.com KP> ------------------------------------------------------- KP> This sf.net email is sponsored by:ThinkGeek KP> Welcome to geek heaven. KP> http://thinkgeek.com/sf KP> _______________________________________________ KP> hibernate-devel mailing list KP> hib...@li... KP> https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- Saludos, Pablo mailto:pi...@ie... |
From: <no...@so...> - 2002-12-28 04:31:19
|
Feature Requests item #650588, was opened at 2002-12-09 09:40 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=650588&group_id=40712 Category: None Group: None >Status: Closed Priority: 4 Submitted By: Gavin King (oneovthafew) Assigned to: Nobody/Anonymous (nobody) Summary: Logging of JDBC parameters Initial Comment: A couple of people have asked to be able to see the actual values written to JDBC "?" parameters in the log. ---------------------------------------------------------------------- >Comment By: Gavin King (oneovthafew) Date: 2002-12-28 15:31 Message: Logged In: YES user_id=384580 Done. ---------------------------------------------------------------------- Comment By: Max R. Andersen (maxcsaucdk) Date: 2002-12-23 10:09 Message: Logged In: YES user_id=18119 A tool like p6spy could solve this issue transparently at the JDBC level. Maybe just mention that in the docs until we get better logging ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=650588&group_id=40712 |
From: <no...@so...> - 2002-12-28 04:30:52
|
Feature Requests item #659016, was opened at 2002-12-28 01:33 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 Category: None Group: None >Status: Closed Priority: 7 Submitted By: Seong Jin, Cho (plusaqua) Assigned to: Gavin King (oneovthafew) Summary: Use bean runtime reflection for query.. Initial Comment: How about using bean runtime reflection to complete query named parameters? I think it will reduce much coding when using, for example, jakarta-struts... Just pass action form to the query..:) ---------------------------------------------------------------------- >Comment By: Gavin King (oneovthafew) Date: 2002-12-28 15:30 Message: Logged In: YES user_id=384580 I implemented this; its in CVS. Please have a play with it and make suggestions for improvements. Gavin. ---------------------------------------------------------------------- Comment By: Gavin King (oneovthafew) Date: 2002-12-28 10:47 Message: Logged In: YES user_id=384580 Very interesting idea! I like it :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 |
From: Gavin K. <Gav...@ex...> - 2002-12-28 04:19:29
|
Ummm theres a bunch of things to get right and since I can't see your mappings, I'm not sure which. However, you should check out the functionality of: * unsaved-value attribute of <id> * cascade attribute of associations * lazy attribute of collections * proxy attribute of <class>, <subclass>, <joined-subclass> by fiddling with those I think all your problems will go away ;) -----Original Message----- From: Matt Raible [mailto:ma...@ra...]=20 Sent: Friday, 27 December 2002 7:34 PM To: hib...@li... Subject: [Hibernate] saveOrUpdate vs. update I have a BaseDAO that contains some generic (I think) Hibernate compatible code. It's basically removeObject, storeObject, and retrieveObject. I've found that Hibernate tries to do an INSERT if I use sess.saveOrUpdate in the following method: protected void storeObject(Object obj) throws DAOException=20 {=20 Session ses =3D null;=20 try {=20 ses =3D sessionFactory.openSession();=20 ses.saveOrUpdate(obj);=20 ses.flush();=20 ses.connection().commit();=20 } catch (Exception e) {=20 try {=20 ses.connection().rollback();=20 } catch (Exception ex) {=20 e.printStackTrace();=20 }=20 ;=20 throw new DAOException(e);=20 } finally {=20 try {=20 ses.close();=20 } catch (Exception ex) {=20 ex.printStackTrace();=20 }=20 ;=20 }=20 }=20 This causes an error, as there is already a user with this name. So I tried changing it to just ses.update(obj), but now I'm getting the following error: [junit] Testcase: testAddResume(org.appfuse.persistence.UserDAOTest): Caused an ERROR=20 [junit] cirrus.hibernate.HibernateException: The given object has a null identifier property [org.appfuse.persistenc e.Resume]=20 [junit] org.appfuse.persistence.DAOException: cirrus.hibernate.HibernateException: The given object has a null ident ifier property [org.appfuse.persistence.Resume]=20 [junit] at org.appfuse.persistence.BaseDAOHibernate.storeObject(BaseDAOHibernate.ja va:117)=20 [junit] at org.appfuse.persistence.UserDAOHibernate.addResume(UserDAOHibernate.java :117)=20 [junit] at org.appfuse.persistence.UserDAOTest.testAddResume(UserDAOTest.java:91)=20 All I'm trying to do is the following:=20 user =3D dao.getUser("tomcat");=20 user.setAddress("new address");=20 User savedUser =3D dao.saveUser(user);=20 assertEquals(savedUser.getAddress(), user.getAddress());=20 But it seems to be trying to go and persist the children - can I turn this off? Also, I've noticed that my user's children are retrieved when I get the user's information. Does this mean that if I create a bunch of mappings from user to other entities, that they're all going to be loaded when I get a user's information? This might not be desirable since I get a user's information when they login, and if they have a whole bunch of records associated with their name... you get the idea... Thanks,=20 Matt=20 ********** 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: <no...@so...> - 2002-12-27 23:47:40
|
Feature Requests item #659016, was opened at 2002-12-28 01:33 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 Category: None Group: None Status: Open >Priority: 7 Submitted By: Seong Jin, Cho (plusaqua) >Assigned to: Gavin King (oneovthafew) Summary: Use bean runtime reflection for query.. Initial Comment: How about using bean runtime reflection to complete query named parameters? I think it will reduce much coding when using, for example, jakarta-struts... Just pass action form to the query..:) ---------------------------------------------------------------------- >Comment By: Gavin King (oneovthafew) Date: 2002-12-28 10:47 Message: Logged In: YES user_id=384580 Very interesting idea! I like it :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 |
From: <no...@so...> - 2002-12-27 14:33:06
|
Feature Requests item #659016, was opened at 2002-12-27 23:33 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 Category: None Group: None Status: Open Priority: 5 Submitted By: Seong Jin, Cho (plusaqua) Assigned to: Nobody/Anonymous (nobody) Summary: Use bean runtime reflection for query.. Initial Comment: How about using bean runtime reflection to complete query named parameters? I think it will reduce much coding when using, for example, jakarta-struts... Just pass action form to the query..:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=659016&group_id=40712 |
From: Sven W. <s_...@in...> - 2002-12-27 10:23:04
|
[snip] > On the other hand, your proposal is no good either, since > it does not return green Foos with bar=null. So it seems > to me like both are imperfect, but existing functionality > is better, because we can force what we mean by adding > "distinct". Ok, I'm happy with the use of "distinct". Maybe we should document that "special OR-case" in combination with "distinct" somewhere. ciao Sven |
From: Konstantin P. <kpr...@ya...> - 2002-12-27 09:33:39
|
--- Gavin King <Gav...@ex...> wrote: > > This is a known limitation of the current Hibernate > XDoclet > module. Now, I think XDoclet can support remote > methods defined > on superclasses in its ejb module, so it must be > possible to > add support for persistent properties defined on > superclasses > to the Hibernate module. > > Anyone know how to attack this problem? This module is merely 2 weeks old, and in no way mature. Maybe not even alpha :) You are welcome to make proposal how it could be made better. I know a lot over xdoclet stuff ( and I'm somehow in charge of developing this module ), but not a lot about hibernate ( I'm learning ) I suggest you to add enhancement issue into JIRA ( xdoclet bug/feature tracking system): http://opensource.atlassian.com/projects/xdoclet/secure/Dashboard.jspa BTW Gavin, it's better than sourceforge one, and atlassian people are hosting open source projects for free. 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: Konstantin P. <kpr...@ya...> - 2002-12-27 09:29:02
|
--- Gavin King <Gav...@ex...> wrote: > Cool. Looks good - I will add a link from the > Hibernate Wiki. > > One comment: > > > _sessionFactory = ( > cirrus.hibernate.SessionFactory ) > > PortableRemoteObject.narrow( ic.lookup( > "java:/hibernate/Samples" ), > > cirrus.hibernate.SessionFactory.class ); > > > It shouldn't be necessary to use > PortableRemoteObject here, right? > The SesionFactory is always a local object, so we > can just typecast. IIRC, everything you get from JNDI shall be narrowed (I read this somewhere). Ant this demo shall demonstrate ghood practices :) 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: <no...@so...> - 2002-12-27 08:59:48
|
Feature Requests item #651407, was opened at 2002-12-10 23:47 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=651407&group_id=40712 Category: None Group: None Status: Closed Priority: 5 Submitted By: Alex Chudnovsky (chud73) Assigned to: Gavin King (oneovthafew) Summary: Unique fields Initial Comment: Have the ability to specify unique fields in the mapping descriptor. ---------------------------------------------------------------------- >Comment By: Alex Chudnovsky (chud73) Date: 2002-12-27 19:59 Message: Logged In: YES user_id=453581 Thanks Gavin :). You rock!!!. ---------------------------------------------------------------------- Comment By: Gavin King (oneovthafew) Date: 2002-12-26 17:20 Message: Logged In: YES user_id=384580 I have implemented this and comitted to CVS. Enjoy :) ---------------------------------------------------------------------- Comment By: Gavin King (oneovthafew) Date: 2002-12-26 17:19 Message: Logged In: YES user_id=384580 I have implemented this and comitted to CVS. Enjoy :) ---------------------------------------------------------------------- Comment By: Alex Chudnovsky (chud73) Date: 2002-12-11 23:32 Message: Logged In: YES user_id=453581 I apologize for the ambiguity, Yes exactly, I mean multiple- column unique constraint. ---------------------------------------------------------------------- Comment By: Gavin King (oneovthafew) Date: 2002-12-11 20:05 Message: Logged In: YES user_id=384580 A single <column> can be specified as unique....do you mean the ability to specify a multiple-column unique constraint? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=651407&group_id=40712 |
From: Matt R. <ma...@ra...> - 2002-12-27 08:34:10
|
I have a BaseDAO that contains some generic (I think) Hibernate compatible code. It's basically removeObject, storeObject, and retrieveObject. I've found that Hibernate tries to do an INSERT if I use sess.saveOrUpdate in the following method: protected void storeObject(Object obj) throws DAOException { Session ses = null; try { ses = sessionFactory.openSession(); ses.saveOrUpdate(obj); ses.flush(); ses.connection().commit(); } catch (Exception e) { try { ses.connection().rollback(); } catch (Exception ex) { e.printStackTrace(); } ; throw new DAOException(e); } finally { try { ses.close(); } catch (Exception ex) { ex.printStackTrace(); } ; } } This causes an error, as there is already a user with this name. So I tried changing it to just ses.update(obj), but now I'm getting the following error: [junit] Testcase: testAddResume(org.appfuse.persistence.UserDAOTest): Caused an ERROR [junit] cirrus.hibernate.HibernateException: The given object has a null identifier property [org.appfuse.persistenc e.Resume] [junit] org.appfuse.persistence.DAOException: cirrus.hibernate.HibernateException: The given object has a null ident ifier property [org.appfuse.persistence.Resume] [junit] at org.appfuse.persistence.BaseDAOHibernate.storeObject(BaseDAOHibernate.ja va:117) [junit] at org.appfuse.persistence.UserDAOHibernate.addResume(UserDAOHibernate.java :117) [junit] at org.appfuse.persistence.UserDAOTest.testAddResume(UserDAOTest.java:91) All I'm trying to do is the following: user = dao.getUser("tomcat"); user.setAddress("new address"); User savedUser = dao.saveUser(user); assertEquals(savedUser.getAddress(), user.getAddress()); But it seems to be trying to go and persist the children - can I turn this off? Also, I've noticed that my user's children are retrieved when I get the user's information. Does this mean that if I create a bunch of mappings from user to other entities, that they're all going to be loaded when I get a user's information? This might not be desirable since I get a user's information when they login, and if they have a whole bunch of records associated with their name. you get the idea. Thanks, Matt |
From: Pablo I. L. <pi...@ie...> - 2002-12-27 03:17:57
|
Hello Gavin, Thursday, December 26, 2002, 3:58:22 AM, you wrote: GK> This is a known limitation of the current Hibernate XDoclet GK> module. Now, I think XDoclet can support remote methods defined GK> on superclasses in its ejb module, so it must be possible to GK> add support for persistent properties defined on superclasses GK> to the Hibernate module. That's right, I've used this feature many times in the past. GK> Anyone know how to attack this problem? >> -----Original Message----- >> From: Pablo I. Lalloni [mailto:pi...@gm...] >> Sent: Tuesday, 24 December 2002 3:53 PM >> To: hib...@li... >> Subject: [Hibernate] Hibernate XDoclet task >> >> >> Hola, >> >> How do I map a superclass attribute using hibernate xdoclet task? >> >> Say you have: >> >> class X { >> private String _something; >> public String getSomething() { >> return _something; >> } >> public void setSomething(String something) { >> _something = something; >> } >> } >> >> class Y extends X { >> private String _another; >> public String getAnother() { >> return _another; >> } >> public void setAnother(String another) { >> _another = another; >> } >> >> } >> >> And want to map class Y to a single table with fields for >> "something" and for "another"... >> >> In Y.hbm.xml you would have: >> >> <class name="Y"> >> <property name="something"/> >> <property name="another"/> >> </class> >> >> How do I generate that mapping with HibernateDoclet? >> >> I this accomplishable? >> >> -- >> Saludos, >> Pablo mailto:pi...@ie... >> >> "The only thing that interferes with my learning is my >> education." Albert Einstein >> >> >> >> >> ------------------------------------------------------- >> 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 >> GK> ********** CAUTION - Disclaimer ********** GK> This message may contain privileged and confidential GK> information. If you are not the intended recipient of this GK> message (or responsible for delivery of the message to GK> such person) you are hereby notified that any use, GK> dissemination, distribution or reproduction of this message GK> is prohibited. If you have received this message in error, GK> you should destroy it and kindly notify the sender by reply GK> e-mail. Please advise immediately if you or your employer GK> do not consent to Internet e-mail for messages of this kind. GK> Opinions, conclusions and other information in this GK> message that do not relate to the official business of GK> Expert Information Services Pty Ltd ("The Company") GK> shall be understood as neither given nor endorsed by it. GK> The Company advises that this e-mail and any attached GK> files should be scanned to detect viruses. The Company GK> accepts no liability for loss or damage (whether caused GK> by negligence or not) resulting from the use of any GK> attached files. GK> **EIS******** End of Disclaimer ********** -- Best regards, Pablo mailto:pi...@ie... |