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: Miso P. <mis...@ya...> - 2002-10-17 14:37:01
|
Hello there! Your hibernate technology is really impressive! I have discovered it a couple of days ago and I am writing couple of quick protypes. It's really easy to use it! I am investigating a hibernate as an option for dealing with persistance for one of my projects at work. Could you tell me: Do you know was hibernate ever deployed in a larger commercial project? Say over 50 persistable classes? Since hibernate is so clever I am wondering what made you write it? There must have been a lot of effort put into it. What's the future of this project? How many people work and contribute to it? Have you considered to make it a jakarta project? Many people are probably asking you questions like that. Maybe if you can reveal some of this background in the FAQ, it can encourage people to use it and spread the word and find new bugs and contribute etc. The second option I am looking at is jboss v3 and using their CMP 2.0 persistence. Jboss is a valid option because I can run most of the code efficiently from within the conatainer and only send the results back to the clients when ready. How does hibernate compare to jboss CMP2.0 persistence? Do you know? Looking forward for your response. Thanks again for making hibernate available! Miso __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com |
From: Max R. A. <ma...@eo...> - 2002-10-17 09:56:38
|
Hi! I was just wondering why you have placed the .java files package directory structure in the root of the Hibernate directory. Why not have a seperate src directory for it ? The current setup confuses e.g. eclipse especically if you build hibernate via ant - then it starts to see the build directory as a set of classes too :) /max |
From: Jon L. <jon...@xe...> - 2002-10-17 05:58:52
|
Shouldn't it be possible to create wrapper reader/writer's for the real reader/writers that implement some kind dirty checking? Perhaps the wrapper reader/writer to read and write to an and from a char[] arrays, and then when we really to to persist the Clob, the wrapper could then write the char[] to the real writer.?.? ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Mark Woon" <mor...@SM...> Cc: <hib...@li...> Sent: Thursday, October 17, 2002 7:35 AM Subject: Re: [Hibernate] ClobType > The fact that I don't know what I think is the main reason I've never added > a ClobType before. I'm assuming that the best way would be to somehow > provide access to the JDBC Clob object (and similarly for Blobs). Is this > possible? Do you need to provide a seperate Holder class? > > I like the reader/writer idea but the trouble with that is how on earth do > you do dirty checking? Hibernate can't compare the reader to the writer to > see if it changed..... > > ----- Original Message ----- > From: "Mark Woon" <mor...@SM...> > To: "Hibernate Mailing List" <hib...@li...> > Sent: Wednesday, October 16, 2002 6:11 PM > Subject: [Hibernate] ClobType > > > > Gavin, > > > > I know I've reported that Hibernate works with CLOB's, but I'm afraid > > that I was wrong. Hibernate persists Strings into CLOB columns > > perfectly fine, but reading it out of the db yields a null. I've added > > a new ClobType to handle CLOB columns to treat them as Strings. I've > > attached a diff and the new file. > > > > I'm not sure that this is the right thing to do, because some may want > > direct access to the Clob object, or would prefer a Reader (in which > > case the setter ought to be a Writer), which would be a lot more > > complicated. If we go with the former, Hibernate would need to > > implement it's own Clob object. What do you think? > > > > -Mark > > > > > > > -------------------------------------------------------------------------- -- > ---- > > > > ? build > > ? patch.diff > > ? cirrus/hibernate/type/ClobType.java > > ? lib/j2ee.jar > > ? lib/junit.jar > > Index: cirrus/hibernate/Hibernate.java > > =================================================================== > > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v > > retrieving revision 1.59 > > diff -c -r1.59 Hibernate.java > > *** cirrus/hibernate/Hibernate.java 5 Oct 2002 04:18:30 -0000 1.59 > > --- cirrus/hibernate/Hibernate.java 16 Oct 2002 08:02:56 -0000 > > *************** > > *** 50,55 **** > > --- 50,59 ---- > > */ > > public static final NullableType STRING = new StringType(); > > /** > > + * Hibernate <tt>clob</tt> type > > + */ > > + public static final NullableType CLOB = new ClobType(); > > + /** > > * Hibernate <tt>time</tt> type > > */ > > public static final NullableType TIME = new TimeType(); > > Index: cirrus/hibernate/impl/SessionImpl.java > > =================================================================== > > RCS file: > /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v > > retrieving revision 1.128 > > diff -c -r1.128 SessionImpl.java > > *** cirrus/hibernate/impl/SessionImpl.java 15 Oct 2002 16:04:05 -0000 > 1.128 > > --- cirrus/hibernate/impl/SessionImpl.java 16 Oct 2002 08:03:04 -0000 > > *************** > > *** 1002,1008 **** > > } > > else if ( old!=null ) { > > throw new HibernateException( > > ! "Another object was associated with this id (the object with the given > id was already loaded)" > > ); > > } > > > > --- 1002,1009 ---- > > } > > else if ( old!=null ) { > > throw new HibernateException( > > ! "Another object of " + object.getClass().toString() + > > ! " has already been loaded with the id " > + id > > ); > > } > > > > Index: cirrus/hibernate/sql/OracleDialect.java > > =================================================================== > > RCS file: > /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/OracleDialect.java,v > > retrieving revision 1.25 > > diff -c -r1.25 OracleDialect.java > > *** cirrus/hibernate/sql/OracleDialect.java 2 Oct 2002 06:27:55 -0000 1.25 > > --- cirrus/hibernate/sql/OracleDialect.java 16 Oct 2002 08:03:05 -0000 > > *************** > > *** 31,36 **** > > --- 31,37 ---- > > register( Types.TIMESTAMP, "DATE" ); > > register( Types.VARBINARY, "RAW($l)" ); > > register( Types.NUMERIC, "NUMBER(19, $l)" ); > > + register( Types.CLOB, "CLOB" ); > > > > outerJoinGenerator = new OracleOuterJoinGenerator(); > > > > Index: cirrus/hibernate/type/TypeFactory.java > > =================================================================== > > RCS file: > /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TypeFactory.java,v > > retrieving revision 1.20 > > diff -c -r1.20 TypeFactory.java > > *** cirrus/hibernate/type/TypeFactory.java 5 Oct 2002 09:33:42 -0000 1.20 > > --- cirrus/hibernate/type/TypeFactory.java 16 Oct 2002 08:03:06 -0000 > > *************** > > *** 39,44 **** > > --- 39,45 ---- > > basics.put( Hibernate.CHARACTER.getName(), Hibernate.CHARACTER); > > basics.put( Hibernate.INTEGER.getName(), Hibernate.INTEGER); > > basics.put( Hibernate.STRING.getName(), Hibernate.STRING); > > + basics.put( Hibernate.CLOB.getName(), Hibernate.CLOB); > > basics.put( Hibernate.DATE.getName(), Hibernate.DATE); > > basics.put( Hibernate.TIME.getName(), Hibernate.TIME); > > basics.put( Hibernate.TIMESTAMP.getName(), Hibernate.TIMESTAMP); > > > > > -------------------------------------------------------------------------- -- > ---- > > > > //$Id: ClobType.java,v 1.17 2002/10/11 05:39:15 oneovthafew Exp $ > > package cirrus.hibernate.type; > > > > import java.sql.Clob; > > import java.sql.PreparedStatement; > > import java.sql.ResultSet; > > import java.sql.SQLException; > > import java.sql.Types; > > > > public class ClobType extends ImmutableType implements DiscriminatorType { > > > > public Object get(ResultSet rs, String name) throws SQLException { > > Clob clob = rs.getClob(name); > > if (clob != null) { > > long len = clob.length(); > > if (len > Integer.MAX_VALUE) { > > long idx = 1; > > StringBuffer buf = new StringBuffer(); > > while (idx < len) { > > long diff = len - idx; > > if (diff > Integer.MAX_VALUE) { > > buf.append(clob.getSubString(idx, Integer.MAX_VALUE)); > > idx += Integer.MAX_VALUE; > > } else { > > buf.append(clob.getSubString(idx, (int)(diff + 1))); > > idx += diff; > > } > > } > > return buf.toString(); > > } else { > > return clob.getSubString(1, (int)len); > > } > > } > > return null; > > } > > > > public Class returnedClass() { > > return String.class; > > } > > > > public void set(PreparedStatement st, Object value, int index) throws > SQLException { > > st.setString(index, (String) value); > > } > > > > public int sqlType() { > > return Types.CLOB; > > } > > > > public String getName() { return "clob"; } > > > > public String objectToSQLString(Object value) throws Exception { > > return '\'' + (String) value + '\''; > > } > > > > public Object stringToObject(String xml) throws Exception { > > return xml; > > } > > > > public boolean equals(Object x, Object y) { > > if (x==y) return true; > > if (x==null || y==null) return false; > > // don't have to check class for String > > return x.equals(y); > > } > > public String toXML(Object value) { > > return (String) value; > > } > > } > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: viaVerio will pay you up to > $1,000 for every account that you consolidate with us. > http://ad.doubleclick.net/clk;4749864;7604308;v? > http://www.viaverio.com/consolidator/osdn.cfm > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Gavin K. <ga...@ap...> - 2002-10-17 05:33:41
|
The fact that I don't know what I think is the main reason I've never added a ClobType before. I'm assuming that the best way would be to somehow provide access to the JDBC Clob object (and similarly for Blobs). Is this possible? Do you need to provide a seperate Holder class? I like the reader/writer idea but the trouble with that is how on earth do you do dirty checking? Hibernate can't compare the reader to the writer to see if it changed..... ----- Original Message ----- From: "Mark Woon" <mor...@SM...> To: "Hibernate Mailing List" <hib...@li...> Sent: Wednesday, October 16, 2002 6:11 PM Subject: [Hibernate] ClobType > Gavin, > > I know I've reported that Hibernate works with CLOB's, but I'm afraid > that I was wrong. Hibernate persists Strings into CLOB columns > perfectly fine, but reading it out of the db yields a null. I've added > a new ClobType to handle CLOB columns to treat them as Strings. I've > attached a diff and the new file. > > I'm not sure that this is the right thing to do, because some may want > direct access to the Clob object, or would prefer a Reader (in which > case the setter ought to be a Writer), which would be a lot more > complicated. If we go with the former, Hibernate would need to > implement it's own Clob object. What do you think? > > -Mark > > ---------------------------------------------------------------------------- ---- > ? build > ? patch.diff > ? cirrus/hibernate/type/ClobType.java > ? lib/j2ee.jar > ? lib/junit.jar > Index: cirrus/hibernate/Hibernate.java > =================================================================== > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v > retrieving revision 1.59 > diff -c -r1.59 Hibernate.java > *** cirrus/hibernate/Hibernate.java 5 Oct 2002 04:18:30 -0000 1.59 > --- cirrus/hibernate/Hibernate.java 16 Oct 2002 08:02:56 -0000 > *************** > *** 50,55 **** > --- 50,59 ---- > */ > public static final NullableType STRING = new StringType(); > /** > + * Hibernate <tt>clob</tt> type > + */ > + public static final NullableType CLOB = new ClobType(); > + /** > * Hibernate <tt>time</tt> type > */ > public static final NullableType TIME = new TimeType(); > Index: cirrus/hibernate/impl/SessionImpl.java > =================================================================== > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v > retrieving revision 1.128 > diff -c -r1.128 SessionImpl.java > *** cirrus/hibernate/impl/SessionImpl.java 15 Oct 2002 16:04:05 -0000 1.128 > --- cirrus/hibernate/impl/SessionImpl.java 16 Oct 2002 08:03:04 -0000 > *************** > *** 1002,1008 **** > } > else if ( old!=null ) { > throw new HibernateException( > ! "Another object was associated with this id (the object with the given id was already loaded)" > ); > } > > --- 1002,1009 ---- > } > else if ( old!=null ) { > throw new HibernateException( > ! "Another object of " + object.getClass().toString() + > ! " has already been loaded with the id " + id > ); > } > > Index: cirrus/hibernate/sql/OracleDialect.java > =================================================================== > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/OracleDialect.java,v > retrieving revision 1.25 > diff -c -r1.25 OracleDialect.java > *** cirrus/hibernate/sql/OracleDialect.java 2 Oct 2002 06:27:55 -0000 1.25 > --- cirrus/hibernate/sql/OracleDialect.java 16 Oct 2002 08:03:05 -0000 > *************** > *** 31,36 **** > --- 31,37 ---- > register( Types.TIMESTAMP, "DATE" ); > register( Types.VARBINARY, "RAW($l)" ); > register( Types.NUMERIC, "NUMBER(19, $l)" ); > + register( Types.CLOB, "CLOB" ); > > outerJoinGenerator = new OracleOuterJoinGenerator(); > > Index: cirrus/hibernate/type/TypeFactory.java > =================================================================== > RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TypeFactory.java,v > retrieving revision 1.20 > diff -c -r1.20 TypeFactory.java > *** cirrus/hibernate/type/TypeFactory.java 5 Oct 2002 09:33:42 -0000 1.20 > --- cirrus/hibernate/type/TypeFactory.java 16 Oct 2002 08:03:06 -0000 > *************** > *** 39,44 **** > --- 39,45 ---- > basics.put( Hibernate.CHARACTER.getName(), Hibernate.CHARACTER); > basics.put( Hibernate.INTEGER.getName(), Hibernate.INTEGER); > basics.put( Hibernate.STRING.getName(), Hibernate.STRING); > + basics.put( Hibernate.CLOB.getName(), Hibernate.CLOB); > basics.put( Hibernate.DATE.getName(), Hibernate.DATE); > basics.put( Hibernate.TIME.getName(), Hibernate.TIME); > basics.put( Hibernate.TIMESTAMP.getName(), Hibernate.TIMESTAMP); > ---------------------------------------------------------------------------- ---- > //$Id: ClobType.java,v 1.17 2002/10/11 05:39:15 oneovthafew Exp $ > package cirrus.hibernate.type; > > import java.sql.Clob; > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Types; > > public class ClobType extends ImmutableType implements DiscriminatorType { > > public Object get(ResultSet rs, String name) throws SQLException { > Clob clob = rs.getClob(name); > if (clob != null) { > long len = clob.length(); > if (len > Integer.MAX_VALUE) { > long idx = 1; > StringBuffer buf = new StringBuffer(); > while (idx < len) { > long diff = len - idx; > if (diff > Integer.MAX_VALUE) { > buf.append(clob.getSubString(idx, Integer.MAX_VALUE)); > idx += Integer.MAX_VALUE; > } else { > buf.append(clob.getSubString(idx, (int)(diff + 1))); > idx += diff; > } > } > return buf.toString(); > } else { > return clob.getSubString(1, (int)len); > } > } > return null; > } > > public Class returnedClass() { > return String.class; > } > > public void set(PreparedStatement st, Object value, int index) throws SQLException { > st.setString(index, (String) value); > } > > public int sqlType() { > return Types.CLOB; > } > > public String getName() { return "clob"; } > > public String objectToSQLString(Object value) throws Exception { > return '\'' + (String) value + '\''; > } > > public Object stringToObject(String xml) throws Exception { > return xml; > } > > public boolean equals(Object x, Object y) { > if (x==y) return true; > if (x==null || y==null) return false; > // don't have to check class for String > return x.equals(y); > } > public String toXML(Object value) { > return (String) value; > } > } > |
From: Alexander S. <ale...@gm...> - 2002-10-16 13:55:05
|
Hi, it seems that I'm too blind (too dumb, too ... whatever) to see my error(s). Can anybody please (please, please, please) zip and send me the directory tree of the working hibernate-example ? The stuff below webapps. I use tomcat 3.2.2 and somehow ... Thanks a lot in advance. My wife is going crazy because of the hours I spend before my machine in the evening. Ciao Alexander Staff, ale...@gm... -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen! |
From: Mark W. <mor...@SM...> - 2002-10-16 08:11:24
|
Gavin, I know I've reported that Hibernate works with CLOB's, but I'm afraid that I was wrong. Hibernate persists Strings into CLOB columns perfectly fine, but reading it out of the db yields a null. I've added a new ClobType to handle CLOB columns to treat them as Strings. I've attached a diff and the new file. I'm not sure that this is the right thing to do, because some may want direct access to the Clob object, or would prefer a Reader (in which case the setter ought to be a Writer), which would be a lot more complicated. If we go with the former, Hibernate would need to implement it's own Clob object. What do you think? -Mark |
From: Gavin K. <ga...@ap...> - 2002-10-15 15:19:28
|
Nope, try this for the last line: myS.load( aBean, aBean ); You can even use myS.load(AgreementBean.class, aBean); ----- Original Message ----- From: "Boring, Jeff W, ALBAS" <jb...@at...> To: <hib...@li...> Sent: Wednesday, October 16, 2002 12:51 AM Subject: [Hibernate] cirrus.hibernate.PropertyAccessException: IllegalArgumentException > Hey: > > I'm getting this exception and don't know how to fix things > > cirrus.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.att.bussys.AgreementBean.xbusinessOwnerId: object is not an instance of declaring class > > I have a composite key. > > <composite-id> > <property column="BUS_OWNER_ID" name="xbusinessOwnerId" type="string" /> > <property column="AGREENUM" name="xagreementNumber" type="string" /> > </composite-id> > > The code is as follows. Is this the proper use of Load with composite id? > > String id = new String ("ADV5387"); > String busOwnId = new String ("ADV"); > String agreeNum = new String ("5387"); > AgreementBean aBean = new AgreementBean(); > aBean.setXbusinessOwnerId( busOwnId ); > aBean.setXagreementNumber( agreeNum ); > > try { > myS.load( aBean, id ); > > > Jeff Boring > Custom & Web Services Development > AT&T Labs > jb...@at... > > > > ------------------------------------------------------- > 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: Boring, J. W, A. <jb...@at...> - 2002-10-15 14:51:13
|
Hey: I'm getting this exception and don't know how to fix things cirrus.hibernate.PropertyAccessException: IllegalArgumentException = occurred calling getter of = com.att.bussys.AgreementBean.xbusinessOwnerId: object is not an instance = of declaring class I have a composite key. <composite-id> <property column=3D"BUS_OWNER_ID" name=3D"xbusinessOwnerId" = type=3D"string" /> <property column=3D"AGREENUM" name=3D"xagreementNumber" = type=3D"string" /> </composite-id> The code is as follows. Is this the proper use of Load with composite = id? String id =3D new String ("ADV5387"); String busOwnId =3D new String ("ADV"); String agreeNum =3D new String ("5387"); AgreementBean aBean =3D new AgreementBean(); aBean.setXbusinessOwnerId( busOwnId ); aBean.setXagreementNumber( agreeNum ); =09 try { myS.load( aBean, id ); =20 =09 Jeff Boring Custom & Web Services Development AT&T Labs jb...@at... |
From: Gavin K. <ga...@ap...> - 2002-10-15 12:25:32
|
> You were right when you said this is a "little involved"... :-) Yeah, I know .... the other part of this (removing the need for a discriminator column is also going to be "involved") ... I still havn't got a handle on the best way to do it. |
From: Jon L. <jon...@xe...> - 2002-10-15 11:41:38
|
Yes, now that makes sense... I'm going to have to think this through a little more, because my current code doesn't take that into consideration. You were right when you said this is a "little involved"... :-) ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Jon Lipsky" <jon...@xe...> Cc: "hibernate list" <hib...@li...> Sent: Tuesday, October 15, 2002 4:13 AM Subject: Re: [Hibernate] Looking for Volunteers > > Currently in the MultiTableEntityPersister there fields such as > > "subclassTableNameClosure" that get initialized with the information about > > the persistant objects subclasses. Currently, when I get the persister > for > > the object "Multi" above, I get information about Simple, Multi, and > > SubMulti. The inclusion of SubMulti in the information is currently what > is > > causing my trouble in generating the SQL statements since I am not using > > outer joins between the tables containing Simple and Multi (and SubMulti, > > since it get's included right now.) > > Yes, SubMulti should be included. Because when we load an object by id or by > a query we don't know if it might be an instance of a subclass at the time > the SQL query is issued. So what happens is that often Hibernate uses a > different persister to *initialize* the object to the one it uses to query > the database. So each MultiTableEntityPersister has the "tableNames" field > to hold all tables used to persist the state of the concrete class, and the > "subclassTableNameClosure" field to hold all tables used to persist the > state of that class and, potentially, its subclasses. > > Make sense? > > ----- Original Message ----- > From: "Jon Lipsky" <jon...@xe...> > To: "Gavin King" <ga...@ap...> > Cc: "hibernate list" <hib...@li...> > Sent: Tuesday, October 15, 2002 12:22 AM > Subject: Re: [Hibernate] Looking for Volunteers > > > > Hey Gavin, > > > > I'm still working on getting the query functionality working with the > > MultipleTableEntityPersister and I have a question that you may be able to > > answer before I go spend hours and hours tracing the functionality. > > > > In order to understand my question, I've attached the mapping xml that I > am > > currently testing with: (which is a modified version of the one currently > > checked into CVS.) > > > > <hibernate-mapping> > > > > <class name="cirrus.hibernate.test.Simple" table="rootclass"> > > <id type="long" column="id_" > > > <generator class="assigned"/> > > </id> > > <version name="count"/> > > <property name="name"/> > > <property name="address"/> > > <property name="date" column="date_"/> > > > > <joined-subclass name="cirrus.hibernate.test.LessSimple" > table="subclass"> > > <superclass-key column="id_"/> > > <property name="intprop"/> > > <one-to-one name="other" class="cirrus.hibernate.test.LessSimple"/> > > <property name="foo" column="other"/> > > </joined-subclass> > > > > <joined-subclass name="cirrus.hibernate.test.Multi" > table="nuthasubclass"> > > <superclass-key column="sid"/> > > <property name="extraProp"/> > > <property name="multiDate" column="date_"/> > > > > <many-to-one name="other" class="cirrus.hibernate.test.Multi"/> > > <many-to-one name="parent" class="cirrus.hibernate.test.Multi"/> > > > > <set role="children" > > > <key column="parent"/> > > <one-to-many class="cirrus.hibernate.test.Multi"/> > > </set> > > > > <joined-subclass name="cirrus.hibernate.test.SubMulti" > table="submulti"> > > <superclass-key column="sid"/> > > <property name="amount"/> > > </joined-subclass> > > > > </joined-subclass> > > > > </class> > > > > </hibernate-mapping> > > > > Now for the question: > > > > Currently in the MultiTableEntityPersister there fields such as > > "subclassTableNameClosure" that get initialized with the information about > > the persistant objects subclasses. Currently, when I get the persister > for > > the object "Multi" above, I get information about Simple, Multi, and > > SubMulti. The inclusion of SubMulti in the information is currently what > is > > causing my trouble in generating the SQL statements since I am not using > > outer joins between the tables containing Simple and Multi (and SubMulti, > > since it get's included right now.) > > > > My question is, did you intend to load the information about SubMulti in > to > > the arrays? Before I go and change something, I wanted to see what your > > original intention of that was. > > > > Thanks, > > Jon... > > > > > > ----- Original Message ----- > > From: "Gavin King" <ga...@ap...> > > To: "Jon Lipsky" <jon...@xe...> > > Cc: "hibernate list" <hib...@li...> > > Sent: Saturday, October 12, 2002 4:53 AM > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > Ace! Thanks Jon ... looking forward :) > > > > > > ----- Original Message ----- > > > From: "Jon Lipsky" <jon...@xe...> > > > To: "Gavin King" <ga...@ap...> > > > Cc: <hib...@li...> > > > Sent: Saturday, October 12, 2002 2:04 AM > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > Hi Gavin, > > > > > > > > I spent a few hours today working on this, and I think I have it about > > > > finished. > > > > > > > > - It can now handle two columns with the same name in different > tables. > > > > - It now will work for both Oracle and Ansi style joins > > > > - It works for insert, update, and load by primary key. > > > > > > > > All I have left to do is finish the "select" code, and then I'll > submit > > it > > > > for you to play around with. Right now, the code for generating the > > > selects > > > > is about finished, all I have left to do is to figure out how to get > the > > > > portion of the select statement needed to load the MultipleTableEntity > > in > > > > sync with the rest (Right now the alias names don't match up.) > > > > > > > > I'll won't be able to continue working on this until Monday, so don't > > > expect > > > > anything before then. > > > > > > > > Jon... > > > > > > > > > > > > ----- Original Message ----- > > > > From: "Gavin King" <ga...@ap...> > > > > To: "Jon Lipsky" <jon...@xe...> > > > > Cc: <hib...@li...> > > > > Sent: Friday, October 11, 2002 9:27 AM > > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > I'm pre-warning you that this will be a bit involved, Jon - and you > > will > > > > > probably have to change the Loadable interface, refactoring some > stuff > > > > thats > > > > > currently done in the Loader hierarchy onto the XXXXEntityPersister > > > > classes. > > > > > > > > > > I don't have an existing testcase, but if you add a many-to-one > > > > association > > > > > to some class in Multi.hbm.xml, that will be enough. > > > > > > > > > > MultiTableEntityPersister implements table-per-subclass persistence. > > > > > EntityPersister implements the old-style persistence. > > > > > > > > > > Currently MultiTableEntityPersister is a valid implementation of > > > > operations > > > > > from ClassPersister and Queryable but *not* of all operations > defined > > on > > > > > Loadable. ie. MultiTableEntityPersister defines the operations > needed > > by > > > > > SimpleEntityLoader but not by OuterJoinLoader. > > > > > > > > > > At the moment, I am generating SQL along the lines of: > > > > > > > > > > select > > > > > t.id as id1, t.clazz as clazz1, t.prop as prop1, > > > > > t1.subprop as subprop1 > > > > > from roottable t > > > > > left outer join subtable t1 > > > > > on t.id = t1.id > > > > > > > > > > for the _query_ stuff. That will have to change in a couple of ways: > > > > > > > > > > (1) it doesn't handle the case of two columns with the same name in > > > > > different tables > > > > > (2) it shouldnt always be an outerjoin really .... sometimes it > should > > > be > > > > > just a join > > > > > > > > > > but thats enough to get us started. Baby steps. So if you generate > > > > something > > > > > similar for outerjoin loading, we will be in business. > > > > > > > > > > P.S. I just noticed that because MultiTableEntityPersister doesn't > > > support > > > > > outerjoin loading, it also can't be loaded by CollectionLoader or > > > > > EntityLoader. So this is an important thing to finish. > > > > > > > > > > > > > > > ----- Original Message ----- > > > > > From: "Jon Lipsky" <jon...@xe...> > > > > > To: "Gavin King" <ga...@ap...> > > > > > Sent: Friday, October 11, 2002 4:34 PM > > > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > > > > Hi Gavin, > > > > > > > > > > > > Not a problem. If you can point me to a valid test case for this, > > I'd > > > > be > > > > > > more than willing to make sure the outer join fetching works. > > > > > > > > > > > > Jon... > > > > > > > > > > > > > > > > > > ----- Original Message ----- > > > > > > From: "Gavin King" <ga...@ap...> > > > > > > To: <hib...@li...> > > > > > > Sent: Wednesday, October 09, 2002 6:56 PM > > > > > > Subject: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > > > > > > > Okay, I finally have something concrete for normalized > > > > > > (table-per-subclass) > > > > > > > mappings. I went down a couple of wrong paths before I decided > on > > > the > > > > > best > > > > > > > approach (a completely new implementation of ClassPersister). > > > > > > > > > > > > > > I can save/load/update/delete instances already. > > > > > > > > > > > > > > We need (in order of importance): > > > > > > > > > > > > > > * SchemaExport support (and proper support in the mapping > > document) > > > > > > > * Query language integration (the hard bit) > > > > > > > * Support for outerjoin fetching > > > > > > > * Support for versioning (easy) > > > > > > > * support for native id-generation (not very hard) > > > > > > > > > > > > > > If anyone wants to help out with any of these problems, I would > > very > > > > > much > > > > > > > appreciate it. > > > > > > > > > > > > > > ( In particular, since Jon Lipsky understands the outerjoin > > fetching > > > > > code, > > > > > > > maybe he would have a look at that stuff? ) > > > > > > > > > > > > > > I'm perhaps being slightly over-eager here, since I still need > to > > > > rework > > > > > > the > > > > > > > map package part of this; what I've got there now is kludge. But > I > > > > will > > > > > do > > > > > > > that (and finish it) tomorrow. When I do that, it will knock the > > top > > > > > item > > > > > > > off the list by side-effect and make the other items doable. > > > > > > > > > > > > > > Anyway, if anyone can spare the time, please stick your hand up > > and > > > I > > > > > will > > > > > > > point in right direction.... > > > > > > > > > > > > > > Gavin > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > 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 > > > > > > > > > > > ------------------------------------------------------- > > 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: Gavin K. <ga...@ap...> - 2002-10-15 03:46:47
|
Hi everyone. Theres a new feature in CVS that lets you write queries like this: "from o in class java.lang.Object" "from n in class eg.Named, m in class eg.Named where n.name = m.name" (eg.Named is an interface implemented by potentially many persistent classes.) By side-effect, we now pretty much support the "table-per-concrete-class" mapping strategy (as much as I would like to, anyway). So once we finish the "table-per-subclass" strategy (ie. MultiTableEntityPersister) we will then support all three mapping strategies defined in the well-known Ambler paper. Funnily enough, this didn't really take me a lot of work, so I've no idea why I didn't do it before.... |
From: Gavin K. <ga...@ap...> - 2002-10-15 02:11:45
|
> Currently in the MultiTableEntityPersister there fields such as > "subclassTableNameClosure" that get initialized with the information about > the persistant objects subclasses. Currently, when I get the persister for > the object "Multi" above, I get information about Simple, Multi, and > SubMulti. The inclusion of SubMulti in the information is currently what is > causing my trouble in generating the SQL statements since I am not using > outer joins between the tables containing Simple and Multi (and SubMulti, > since it get's included right now.) Yes, SubMulti should be included. Because when we load an object by id or by a query we don't know if it might be an instance of a subclass at the time the SQL query is issued. So what happens is that often Hibernate uses a different persister to *initialize* the object to the one it uses to query the database. So each MultiTableEntityPersister has the "tableNames" field to hold all tables used to persist the state of the concrete class, and the "subclassTableNameClosure" field to hold all tables used to persist the state of that class and, potentially, its subclasses. Make sense? ----- Original Message ----- From: "Jon Lipsky" <jon...@xe...> To: "Gavin King" <ga...@ap...> Cc: "hibernate list" <hib...@li...> Sent: Tuesday, October 15, 2002 12:22 AM Subject: Re: [Hibernate] Looking for Volunteers > Hey Gavin, > > I'm still working on getting the query functionality working with the > MultipleTableEntityPersister and I have a question that you may be able to > answer before I go spend hours and hours tracing the functionality. > > In order to understand my question, I've attached the mapping xml that I am > currently testing with: (which is a modified version of the one currently > checked into CVS.) > > <hibernate-mapping> > > <class name="cirrus.hibernate.test.Simple" table="rootclass"> > <id type="long" column="id_" > > <generator class="assigned"/> > </id> > <version name="count"/> > <property name="name"/> > <property name="address"/> > <property name="date" column="date_"/> > > <joined-subclass name="cirrus.hibernate.test.LessSimple" table="subclass"> > <superclass-key column="id_"/> > <property name="intprop"/> > <one-to-one name="other" class="cirrus.hibernate.test.LessSimple"/> > <property name="foo" column="other"/> > </joined-subclass> > > <joined-subclass name="cirrus.hibernate.test.Multi" table="nuthasubclass"> > <superclass-key column="sid"/> > <property name="extraProp"/> > <property name="multiDate" column="date_"/> > > <many-to-one name="other" class="cirrus.hibernate.test.Multi"/> > <many-to-one name="parent" class="cirrus.hibernate.test.Multi"/> > > <set role="children" > > <key column="parent"/> > <one-to-many class="cirrus.hibernate.test.Multi"/> > </set> > > <joined-subclass name="cirrus.hibernate.test.SubMulti" table="submulti"> > <superclass-key column="sid"/> > <property name="amount"/> > </joined-subclass> > > </joined-subclass> > > </class> > > </hibernate-mapping> > > Now for the question: > > Currently in the MultiTableEntityPersister there fields such as > "subclassTableNameClosure" that get initialized with the information about > the persistant objects subclasses. Currently, when I get the persister for > the object "Multi" above, I get information about Simple, Multi, and > SubMulti. The inclusion of SubMulti in the information is currently what is > causing my trouble in generating the SQL statements since I am not using > outer joins between the tables containing Simple and Multi (and SubMulti, > since it get's included right now.) > > My question is, did you intend to load the information about SubMulti in to > the arrays? Before I go and change something, I wanted to see what your > original intention of that was. > > Thanks, > Jon... > > > ----- Original Message ----- > From: "Gavin King" <ga...@ap...> > To: "Jon Lipsky" <jon...@xe...> > Cc: "hibernate list" <hib...@li...> > Sent: Saturday, October 12, 2002 4:53 AM > Subject: Re: [Hibernate] Looking for Volunteers > > > > Ace! Thanks Jon ... looking forward :) > > > > ----- Original Message ----- > > From: "Jon Lipsky" <jon...@xe...> > > To: "Gavin King" <ga...@ap...> > > Cc: <hib...@li...> > > Sent: Saturday, October 12, 2002 2:04 AM > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > Hi Gavin, > > > > > > I spent a few hours today working on this, and I think I have it about > > > finished. > > > > > > - It can now handle two columns with the same name in different tables. > > > - It now will work for both Oracle and Ansi style joins > > > - It works for insert, update, and load by primary key. > > > > > > All I have left to do is finish the "select" code, and then I'll submit > it > > > for you to play around with. Right now, the code for generating the > > selects > > > is about finished, all I have left to do is to figure out how to get the > > > portion of the select statement needed to load the MultipleTableEntity > in > > > sync with the rest (Right now the alias names don't match up.) > > > > > > I'll won't be able to continue working on this until Monday, so don't > > expect > > > anything before then. > > > > > > Jon... > > > > > > > > > ----- Original Message ----- > > > From: "Gavin King" <ga...@ap...> > > > To: "Jon Lipsky" <jon...@xe...> > > > Cc: <hib...@li...> > > > Sent: Friday, October 11, 2002 9:27 AM > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > I'm pre-warning you that this will be a bit involved, Jon - and you > will > > > > probably have to change the Loadable interface, refactoring some stuff > > > thats > > > > currently done in the Loader hierarchy onto the XXXXEntityPersister > > > classes. > > > > > > > > I don't have an existing testcase, but if you add a many-to-one > > > association > > > > to some class in Multi.hbm.xml, that will be enough. > > > > > > > > MultiTableEntityPersister implements table-per-subclass persistence. > > > > EntityPersister implements the old-style persistence. > > > > > > > > Currently MultiTableEntityPersister is a valid implementation of > > > operations > > > > from ClassPersister and Queryable but *not* of all operations defined > on > > > > Loadable. ie. MultiTableEntityPersister defines the operations needed > by > > > > SimpleEntityLoader but not by OuterJoinLoader. > > > > > > > > At the moment, I am generating SQL along the lines of: > > > > > > > > select > > > > t.id as id1, t.clazz as clazz1, t.prop as prop1, > > > > t1.subprop as subprop1 > > > > from roottable t > > > > left outer join subtable t1 > > > > on t.id = t1.id > > > > > > > > for the _query_ stuff. That will have to change in a couple of ways: > > > > > > > > (1) it doesn't handle the case of two columns with the same name in > > > > different tables > > > > (2) it shouldnt always be an outerjoin really .... sometimes it should > > be > > > > just a join > > > > > > > > but thats enough to get us started. Baby steps. So if you generate > > > something > > > > similar for outerjoin loading, we will be in business. > > > > > > > > P.S. I just noticed that because MultiTableEntityPersister doesn't > > support > > > > outerjoin loading, it also can't be loaded by CollectionLoader or > > > > EntityLoader. So this is an important thing to finish. > > > > > > > > > > > > ----- Original Message ----- > > > > From: "Jon Lipsky" <jon...@xe...> > > > > To: "Gavin King" <ga...@ap...> > > > > Sent: Friday, October 11, 2002 4:34 PM > > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > Hi Gavin, > > > > > > > > > > Not a problem. If you can point me to a valid test case for this, > I'd > > > be > > > > > more than willing to make sure the outer join fetching works. > > > > > > > > > > Jon... > > > > > > > > > > > > > > > ----- Original Message ----- > > > > > From: "Gavin King" <ga...@ap...> > > > > > To: <hib...@li...> > > > > > Sent: Wednesday, October 09, 2002 6:56 PM > > > > > Subject: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > > > > Okay, I finally have something concrete for normalized > > > > > (table-per-subclass) > > > > > > mappings. I went down a couple of wrong paths before I decided on > > the > > > > best > > > > > > approach (a completely new implementation of ClassPersister). > > > > > > > > > > > > I can save/load/update/delete instances already. > > > > > > > > > > > > We need (in order of importance): > > > > > > > > > > > > * SchemaExport support (and proper support in the mapping > document) > > > > > > * Query language integration (the hard bit) > > > > > > * Support for outerjoin fetching > > > > > > * Support for versioning (easy) > > > > > > * support for native id-generation (not very hard) > > > > > > > > > > > > If anyone wants to help out with any of these problems, I would > very > > > > much > > > > > > appreciate it. > > > > > > > > > > > > ( In particular, since Jon Lipsky understands the outerjoin > fetching > > > > code, > > > > > > maybe he would have a look at that stuff? ) > > > > > > > > > > > > I'm perhaps being slightly over-eager here, since I still need to > > > rework > > > > > the > > > > > > map package part of this; what I've got there now is kludge. But I > > > will > > > > do > > > > > > that (and finish it) tomorrow. When I do that, it will knock the > top > > > > item > > > > > > off the list by side-effect and make the other items doable. > > > > > > > > > > > > Anyway, if anyone can spare the time, please stick your hand up > and > > I > > > > will > > > > > > point in right direction.... > > > > > > > > > > > > Gavin > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > 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 > > > > > > ------------------------------------------------------- > 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: Jon L. <jon...@xe...> - 2002-10-14 14:23:56
|
Hey Gavin, I'm still working on getting the query functionality working with the MultipleTableEntityPersister and I have a question that you may be able to answer before I go spend hours and hours tracing the functionality. In order to understand my question, I've attached the mapping xml that I am currently testing with: (which is a modified version of the one currently checked into CVS.) <hibernate-mapping> <class name="cirrus.hibernate.test.Simple" table="rootclass"> <id type="long" column="id_" > <generator class="assigned"/> </id> <version name="count"/> <property name="name"/> <property name="address"/> <property name="date" column="date_"/> <joined-subclass name="cirrus.hibernate.test.LessSimple" table="subclass"> <superclass-key column="id_"/> <property name="intprop"/> <one-to-one name="other" class="cirrus.hibernate.test.LessSimple"/> <property name="foo" column="other"/> </joined-subclass> <joined-subclass name="cirrus.hibernate.test.Multi" table="nuthasubclass"> <superclass-key column="sid"/> <property name="extraProp"/> <property name="multiDate" column="date_"/> <many-to-one name="other" class="cirrus.hibernate.test.Multi"/> <many-to-one name="parent" class="cirrus.hibernate.test.Multi"/> <set role="children" > <key column="parent"/> <one-to-many class="cirrus.hibernate.test.Multi"/> </set> <joined-subclass name="cirrus.hibernate.test.SubMulti" table="submulti"> <superclass-key column="sid"/> <property name="amount"/> </joined-subclass> </joined-subclass> </class> </hibernate-mapping> Now for the question: Currently in the MultiTableEntityPersister there fields such as "subclassTableNameClosure" that get initialized with the information about the persistant objects subclasses. Currently, when I get the persister for the object "Multi" above, I get information about Simple, Multi, and SubMulti. The inclusion of SubMulti in the information is currently what is causing my trouble in generating the SQL statements since I am not using outer joins between the tables containing Simple and Multi (and SubMulti, since it get's included right now.) My question is, did you intend to load the information about SubMulti in to the arrays? Before I go and change something, I wanted to see what your original intention of that was. Thanks, Jon... ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Jon Lipsky" <jon...@xe...> Cc: "hibernate list" <hib...@li...> Sent: Saturday, October 12, 2002 4:53 AM Subject: Re: [Hibernate] Looking for Volunteers > Ace! Thanks Jon ... looking forward :) > > ----- Original Message ----- > From: "Jon Lipsky" <jon...@xe...> > To: "Gavin King" <ga...@ap...> > Cc: <hib...@li...> > Sent: Saturday, October 12, 2002 2:04 AM > Subject: Re: [Hibernate] Looking for Volunteers > > > > Hi Gavin, > > > > I spent a few hours today working on this, and I think I have it about > > finished. > > > > - It can now handle two columns with the same name in different tables. > > - It now will work for both Oracle and Ansi style joins > > - It works for insert, update, and load by primary key. > > > > All I have left to do is finish the "select" code, and then I'll submit it > > for you to play around with. Right now, the code for generating the > selects > > is about finished, all I have left to do is to figure out how to get the > > portion of the select statement needed to load the MultipleTableEntity in > > sync with the rest (Right now the alias names don't match up.) > > > > I'll won't be able to continue working on this until Monday, so don't > expect > > anything before then. > > > > Jon... > > > > > > ----- Original Message ----- > > From: "Gavin King" <ga...@ap...> > > To: "Jon Lipsky" <jon...@xe...> > > Cc: <hib...@li...> > > Sent: Friday, October 11, 2002 9:27 AM > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > I'm pre-warning you that this will be a bit involved, Jon - and you will > > > probably have to change the Loadable interface, refactoring some stuff > > thats > > > currently done in the Loader hierarchy onto the XXXXEntityPersister > > classes. > > > > > > I don't have an existing testcase, but if you add a many-to-one > > association > > > to some class in Multi.hbm.xml, that will be enough. > > > > > > MultiTableEntityPersister implements table-per-subclass persistence. > > > EntityPersister implements the old-style persistence. > > > > > > Currently MultiTableEntityPersister is a valid implementation of > > operations > > > from ClassPersister and Queryable but *not* of all operations defined on > > > Loadable. ie. MultiTableEntityPersister defines the operations needed by > > > SimpleEntityLoader but not by OuterJoinLoader. > > > > > > At the moment, I am generating SQL along the lines of: > > > > > > select > > > t.id as id1, t.clazz as clazz1, t.prop as prop1, > > > t1.subprop as subprop1 > > > from roottable t > > > left outer join subtable t1 > > > on t.id = t1.id > > > > > > for the _query_ stuff. That will have to change in a couple of ways: > > > > > > (1) it doesn't handle the case of two columns with the same name in > > > different tables > > > (2) it shouldnt always be an outerjoin really .... sometimes it should > be > > > just a join > > > > > > but thats enough to get us started. Baby steps. So if you generate > > something > > > similar for outerjoin loading, we will be in business. > > > > > > P.S. I just noticed that because MultiTableEntityPersister doesn't > support > > > outerjoin loading, it also can't be loaded by CollectionLoader or > > > EntityLoader. So this is an important thing to finish. > > > > > > > > > ----- Original Message ----- > > > From: "Jon Lipsky" <jon...@xe...> > > > To: "Gavin King" <ga...@ap...> > > > Sent: Friday, October 11, 2002 4:34 PM > > > Subject: Re: [Hibernate] Looking for Volunteers > > > > > > > > > > Hi Gavin, > > > > > > > > Not a problem. If you can point me to a valid test case for this, I'd > > be > > > > more than willing to make sure the outer join fetching works. > > > > > > > > Jon... > > > > > > > > > > > > ----- Original Message ----- > > > > From: "Gavin King" <ga...@ap...> > > > > To: <hib...@li...> > > > > Sent: Wednesday, October 09, 2002 6:56 PM > > > > Subject: [Hibernate] Looking for Volunteers > > > > > > > > > > > > > Okay, I finally have something concrete for normalized > > > > (table-per-subclass) > > > > > mappings. I went down a couple of wrong paths before I decided on > the > > > best > > > > > approach (a completely new implementation of ClassPersister). > > > > > > > > > > I can save/load/update/delete instances already. > > > > > > > > > > We need (in order of importance): > > > > > > > > > > * SchemaExport support (and proper support in the mapping document) > > > > > * Query language integration (the hard bit) > > > > > * Support for outerjoin fetching > > > > > * Support for versioning (easy) > > > > > * support for native id-generation (not very hard) > > > > > > > > > > If anyone wants to help out with any of these problems, I would very > > > much > > > > > appreciate it. > > > > > > > > > > ( In particular, since Jon Lipsky understands the outerjoin fetching > > > code, > > > > > maybe he would have a look at that stuff? ) > > > > > > > > > > I'm perhaps being slightly over-eager here, since I still need to > > rework > > > > the > > > > > map package part of this; what I've got there now is kludge. But I > > will > > > do > > > > > that (and finish it) tomorrow. When I do that, it will knock the top > > > item > > > > > off the list by side-effect and make the other items doable. > > > > > > > > > > Anyway, if anyone can spare the time, please stick your hand up and > I > > > will > > > > > point in right direction.... > > > > > > > > > > Gavin > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > 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 > > > > > > > > > > > > > > > > ------------------------------------------------------- > > 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: Christoph S. <ch...@sc...> - 2002-10-13 18:49:38
|
Gavin King wrote: >>Hadnt thought of that, thanks, >> >>Would it be possible to add my definitions to the DataStore, and then >>recreate or reinitialize the SessionFactoryImpl? >> >>Then I could build a guy where the user can define his new tables, and >>modify just the DataStore, and when he clicks on "apply", i update the >>db and recreate the SessionFactoryImpl. >> >>Would that work? >> >> > >Can't think why not. Should be fine. The Datastore is designed to allow >multiple calls to buildSessionFactory (but you should watch out for bugs in >that because its not covered in the test suite!) > > Cool. Then I will start with dynamic schema update. -chris > > >------------------------------------------------------- >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: Gavin K. <ga...@ap...> - 2002-10-13 16:50:33
|
> Hadnt thought of that, thanks, > > Would it be possible to add my definitions to the DataStore, and then > recreate or reinitialize the SessionFactoryImpl? > > Then I could build a guy where the user can define his new tables, and > modify just the DataStore, and when he clicks on "apply", i update the > db and recreate the SessionFactoryImpl. > > Would that work? Can't think why not. Should be fine. The Datastore is designed to allow multiple calls to buildSessionFactory (but you should watch out for bugs in that because its not covered in the test suite!) |
From: Christoph S. <ch...@sc...> - 2002-10-13 16:41:39
|
Hey Gavin! Gavin King wrote: >>I think we should take the former option, one persister per class. Then >>we should be able to add new Persisters at runtime. (And change the >>field definitions of existing persisters) >> >> > >Okay, cool, but how are you going to do that without requiring a >synchronized method each time we look up a ClassPersister (which happens >very often)? > >I think you will need to think very carefully about the whole add/lookup >dynamic ClassPersister issue. It seems to be a major departure from the >current model that there is an immutable collection of immutable >ClassPersisters. > > Hadnt thought of that, thanks, Would it be possible to add my definitions to the DataStore, and then recreate or reinitialize the SessionFactoryImpl? Then I could build a guy where the user can define his new tables, and modify just the DataStore, and when he clicks on "apply", i update the db and recreate the SessionFactoryImpl. Would that work? chris |
From: Gavin K. <ga...@ap...> - 2002-10-13 16:19:48
|
> >Christoph, someone else once asked for this, so it might well be worth the > >effort. > > > I hope it wasnt me :) Nope: http://sourceforge.net/forum/message.php?msg_id=1634640 :) |
From: Gavin K. <ga...@ap...> - 2002-10-13 16:13:35
|
> I think we should take the former option, one persister per class. Then > we should be able to add new Persisters at runtime. (And change the > field definitions of existing persisters) Okay, cool, but how are you going to do that without requiring a synchronized method each time we look up a ClassPersister (which happens very often)? I think you will need to think very carefully about the whole add/lookup dynamic ClassPersister issue. It seems to be a major departure from the current model that there is an immutable collection of immutable ClassPersisters. |
From: Christoph S. <ch...@sc...> - 2002-10-13 15:58:26
|
Gavin King wrote: >Christoph, someone else once asked for this, so it might well be worth the >effort. > I hope it wasnt me :) > However, I wouldn't like to change the API if we can possibly help >it. Now, it might turn out that we don't need to change the API. > >(1) How do you plan to persist these DynaBeans? A table that contains >property name/value pairs seems most reasonable if you need users to be able >to specify new properties at runtime ... or did you intend to export tables >dynamically at runtime? > I want to create a new table for each dynabean. Then I'd also implement the dynamic schema update that I was mentioning long time ago :) >(2) Would it be possible to load an instance like this: > >session.load( DynaBean.class, new DynaBeanKey("dynamic.class.name", >identifier) ); > cool, that would be a good way, since we wouldnt need to change the api. > >(3) Not sure of the best way to write a ClassPersister for DynaBeans. Should >there be a single persister for each class, or one for all classes? If the >latter, you might need to change the ClassPersister interface to accommodate >this new notion of a ClassPersister that persists multiple "classes". If the >former, does that mean we need to be able to add new DynaBeanPersisters at >runtime? > I think we should take the former option, one persister per class. Then we should be able to add new Persisters at runtime. (And change the field definitions of existing persisters) hmm, do we need a new kind of class persister? I dont thimk so. IMHO the best solution would be to factor out the bean access of the existing ClassPersisters, and make that pluggable. > >Gavin > >----- Original Message ----- >From: "Christoph Sturm" <ch...@sc...> >To: <hib...@li...> >Sent: Sunday, October 13, 2002 12:47 AM >Subject: [Hibernate] support for dynabeans > > > > >>Hi All! >> >>I'd like to implement a new feature in Hibernate, but I dont know how to >>start best. I would like to be able to map classes that dont really >>exist as javaclass, but use a dynabean instead >> >> >> >http://www.apache.org/~jvanzyl/jakarta-commons/beanutils/apidocs/org/apache/ >commons/beanutils/DynaBean.html > > >>(or a map). All seems to be quite easy, refactor all stuff that loads >>and initializes a bean to a pluggable factory, and there if the loading >>of the class fails just create or initialize a Dynabean or Map (or maybe >>a HibernateGenericValueHolder) instead. >> >>The only problem is: >>The Hibernate API :) >>Session.load, Session.update, etc all get a java.lang.Class Argument. Do >>you think it would be possible to add functions that get a classname as >>String instead? Maybe the functions that take a string as argument >>should always use Holders instead of beans. >>I realize that this would be big changes, but if you think that this >>would be a good idea, I would just go ahead and try to implement it. >> >> >> >>The inspiration to this comes from the ofbiz entity engine, which always >>uses generic holders instead of Beans, which i dont really like, but its >>really nice for some usecases, e.g. letting your user add colums to a >>table at runtime without restarting the server. I recognize that i could >>dynamically generate a bean with bcel, but once that bean is loaded i >>cant add properties to it, so I'd really prefer a map. >> >>regards >> chris >> >> >> >> >>------------------------------------------------------- >>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: Gavin K. <ga...@ap...> - 2002-10-13 15:44:57
|
Christoph, someone else once asked for this, so it might well be worth the effort. However, I wouldn't like to change the API if we can possibly help it. Now, it might turn out that we don't need to change the API. (1) How do you plan to persist these DynaBeans? A table that contains property name/value pairs seems most reasonable if you need users to be able to specify new properties at runtime ... or did you intend to export tables dynamically at runtime? (2) Would it be possible to load an instance like this: session.load( DynaBean.class, new DynaBeanKey("dynamic.class.name", identifier) ); (3) Not sure of the best way to write a ClassPersister for DynaBeans. Should there be a single persister for each class, or one for all classes? If the latter, you might need to change the ClassPersister interface to accommodate this new notion of a ClassPersister that persists multiple "classes". If the former, does that mean we need to be able to add new DynaBeanPersisters at runtime? Gavin ----- Original Message ----- From: "Christoph Sturm" <ch...@sc...> To: <hib...@li...> Sent: Sunday, October 13, 2002 12:47 AM Subject: [Hibernate] support for dynabeans > Hi All! > > I'd like to implement a new feature in Hibernate, but I dont know how to > start best. I would like to be able to map classes that dont really > exist as javaclass, but use a dynabean instead > http://www.apache.org/~jvanzyl/jakarta-commons/beanutils/apidocs/org/apache/ commons/beanutils/DynaBean.html > (or a map). All seems to be quite easy, refactor all stuff that loads > and initializes a bean to a pluggable factory, and there if the loading > of the class fails just create or initialize a Dynabean or Map (or maybe > a HibernateGenericValueHolder) instead. > > The only problem is: > The Hibernate API :) > Session.load, Session.update, etc all get a java.lang.Class Argument. Do > you think it would be possible to add functions that get a classname as > String instead? Maybe the functions that take a string as argument > should always use Holders instead of beans. > I realize that this would be big changes, but if you think that this > would be a good idea, I would just go ahead and try to implement it. > > > > The inspiration to this comes from the ofbiz entity engine, which always > uses generic holders instead of Beans, which i dont really like, but its > really nice for some usecases, e.g. letting your user add colums to a > table at runtime without restarting the server. I recognize that i could > dynamically generate a bean with bcel, but once that bean is loaded i > cant add properties to it, so I'd really prefer a map. > > regards > chris > > > > > ------------------------------------------------------- > 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: Gavin K. <ga...@ap...> - 2002-10-13 02:39:23
|
Yeah, this is already fixed in CVS.... ----- Original Message ----- From: "Anton van Straaten" <an...@ap...> To: <hib...@li...> Sent: Sunday, October 13, 2002 5:27 AM Subject: RE: [Hibernate] lost exception > > In SessionFactoryImpl, the catch clause which throws a > > MappingException with the message "Could not instantiate > > persister class:..." (line 180 in v1.1.4b) discards the > > more detailed exception it receives (e). > ... > > I found that the exception that was discarded read "Could not > > find a setter for..." > > My description above is inaccurate: the actual discarded exception is a > java.lang.reflect.InvocationTargetException, and its "target" variable > contains the MappingException with the message "Could not find a setter > for...". So simply adding "+ e.toString()" or similar doesn't help the > situation. > > > > ------------------------------------------------------- > 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: Anton v. S. <an...@ap...> - 2002-10-12 19:26:42
|
> In SessionFactoryImpl, the catch clause which throws a > MappingException with the message "Could not instantiate > persister class:..." (line 180 in v1.1.4b) discards the > more detailed exception it receives (e). ... > I found that the exception that was discarded read "Could not > find a setter for..." My description above is inaccurate: the actual discarded exception is a java.lang.reflect.InvocationTargetException, and its "target" variable contains the MappingException with the message "Could not find a setter for...". So simply adding "+ e.toString()" or similar doesn't help the situation. |
From: Anton v. S. <an...@ap...> - 2002-10-12 19:01:16
|
In SessionFactoryImpl, the catch clause which throws a MappingException with the message "Could not instantiate persister class:..." (line 180 in v1.1.4b) discards the more detailed exception it receives (e). In my case, I did something dumb - adding a new key column to a table without adding the corresponding getter/setter - and then had to figure out what "Could not instantiate persister class..." was trying to tell me. Via debugging, I found that the exception that was discarded read "Could not find a setter for..." which would have been a lot more helpful, especially while suffering from a case of lamebrain... Not sure what the Hibernate-appropriate fix should be - the ideal solution in this kind of case, IMO, would be to throw a chained exception (like the JDK 1.4 feature), so that exception context is not lost. Is Hibernate using anything like that? I haven't noticed. If not, just tacking the exception strings together would work in this case. Anton |
From: Christoph S. <ch...@sc...> - 2002-10-12 14:48:54
|
Hi All! I'd like to implement a new feature in Hibernate, but I dont know how to start best. I would like to be able to map classes that dont really exist as javaclass, but use a dynabean instead http://www.apache.org/~jvanzyl/jakarta-commons/beanutils/apidocs/org/apache/commons/beanutils/DynaBean.html (or a map). All seems to be quite easy, refactor all stuff that loads and initializes a bean to a pluggable factory, and there if the loading of the class fails just create or initialize a Dynabean or Map (or maybe a HibernateGenericValueHolder) instead. The only problem is: The Hibernate API :) Session.load, Session.update, etc all get a java.lang.Class Argument. Do you think it would be possible to add functions that get a classname as String instead? Maybe the functions that take a string as argument should always use Holders instead of beans. I realize that this would be big changes, but if you think that this would be a good idea, I would just go ahead and try to implement it. The inspiration to this comes from the ofbiz entity engine, which always uses generic holders instead of Beans, which i dont really like, but its really nice for some usecases, e.g. letting your user add colums to a table at runtime without restarting the server. I recognize that i could dynamically generate a bean with bcel, but once that bean is loaded i cant add properties to it, so I'd really prefer a map. regards chris |
From: Gavin K. <ga...@ap...> - 2002-10-12 08:47:52
|
I think I've fixed this problem now. (But I did it without first reproducing the bug.) Mark, would you do me a favor, please: (1) check the fix works (2) add a regression test to FooBarTest that Thanks.... Gavin ----- Original Message ----- From: "Mark Woon" <mor...@SM...> Cc: "Hibernate Mailing List" <hib...@li...> Sent: Saturday, October 12, 2002 11:28 AM Subject: Re: [Hibernate] Failure to lazily initialize a collection > Mark Woon wrote: > > > Here's the mapping I'm using for the set: > > > > <set role="referenceSequences" table="ReferenceSequenceGeneAssoc" > > lazy="true" cascade="all"> > > <key column="geneId" type="string" /> > > <many-to-many column="referenceSequenceId" > > class="org.pharmgen.db.DbReferenceSequence" /> > > </set> > > > And if I change it to lazy="false," I get: > > java.lang.NullPointerException > at cirrus.hibernate.LockMode.greaterThan(LockMode.java:30) > at cirrus.hibernate.impl.SessionImpl.lock(SessionImpl.java:1121) > at cirrus.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1412) > at > cirrus.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1314) > at > cirrus.hibernate.impl.SessionImpl.internalLoadOneToOne(SessionImpl.java:1273 ) > at > cirrus.hibernate.type.OneToOneType.resolveIdentifier(OneToOneType.java:68) > at > cirrus.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1456) > at cirrus.hibernate.loader.Loader.doFind(Loader.java:144) > at cirrus.hibernate.loader.Loader.loadCollection(Loader.java:448) > at > cirrus.hibernate.loader.CollectionLoader.initialize(CollectionLoader.java:67 ) > at > cirrus.hibernate.impl.SessionImpl.initialize(SessionImpl.java:2222) > at > cirrus.hibernate.collections.PersistentCollection.getInitialValue(Persistent Collection.java:69) > at > cirrus.hibernate.type.PersistentCollectionType.getCollection(PersistentColle ctionType.java:69) > at > cirrus.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentC ollectionType.java:198) > at > cirrus.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1456) > at cirrus.hibernate.loader.Loader.doFind(Loader.java:171) > at cirrus.hibernate.loader.Loader.loadEntity(Loader.java:435) > at cirrus.hibernate.loader.EntityLoader.load(EntityLoader.java:61) > at > cirrus.hibernate.persister.EntityPersister.load(EntityPersister.java:406) > at cirrus.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1440) > at > cirrus.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1314) > at cirrus.hibernate.impl.SessionImpl.load(SessionImpl.java:1253) > at misc.Test.test(Test.java:61) > at misc.Test.main(Test.java:40) > > With the 1.1.4b build I get: > > cirrus.hibernate.TransientObjectException: You tried to lock a transient > instance > at cirrus.hibernate.impl.SessionImpl.lock(SessionImpl.java:1113) > at cirrus.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1404) > at > cirrus.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1306) > at > cirrus.hibernate.impl.SessionImpl.internalLoadOneToOne(SessionImpl.java:1265 ) > at > cirrus.hibernate.type.OneToOneType.resolveIdentifier(OneToOneType.java:68) > at > cirrus.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1448) > at cirrus.hibernate.loader.Loader.doFind(Loader.java:144) > at cirrus.hibernate.loader.Loader.loadCollection(Loader.java:448) > at > cirrus.hibernate.loader.CollectionLoader.initialize(CollectionLoader.java:67 ) > at > cirrus.hibernate.impl.SessionImpl.initialize(SessionImpl.java:2213) > at > cirrus.hibernate.collections.PersistentCollection.getInitialValue(Persistent Collection.java:69) > at > cirrus.hibernate.type.PersistentCollectionType.getCollection(PersistentColle ctionType.java:69) > at > cirrus.hibernate.type.PersistentCollectionType.resolveIdentifier(PersistentC ollectionType.java:198) > at > cirrus.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1448) > at cirrus.hibernate.loader.Loader.doFind(Loader.java:171) > at cirrus.hibernate.loader.Loader.loadEntity(Loader.java:435) > at cirrus.hibernate.loader.EntityLoader.load(EntityLoader.java:61) > at > cirrus.hibernate.persister.EntityPersister.load(EntityPersister.java:666) > at cirrus.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1432) > at > cirrus.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1306) > at cirrus.hibernate.impl.SessionImpl.load(SessionImpl.java:1245) > at misc.Test.test(Test.java:61) > at misc.Test.main(Test.java:40) > > > BTW, all this works with 1.3! > > -Mark > > > > ------------------------------------------------------- > 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 |