From: Mark W. <mor...@SM...> - 2002-10-16 08:11:24
Attachments:
patch.diff
ClobType.java
|
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-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: 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 18:21:15
|
Yes! I like this idea a lotfully. Good thinking :) ----- Original Message ----- From: "Jon Lipsky" <jon...@xe...> To: "Gavin King" <ga...@ap...> Cc: <hib...@li...> Sent: Thursday, October 17, 2002 3:58 PM Subject: Re: [Hibernate] ClobType > 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 > > > > > > ------------------------------------------------------- > 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: Mark W. <mor...@SM...> - 2002-10-19 02:29:48
|
Gavin King wrote: >Yes! I like this idea a lotfully. Good thinking :) > Ok, unless someone else is working on this, I'm going to try to hammer something out that'll handle Clobs nicely over the weekend. Any advice/suggestions are more than welcome. Gavin, I'm not really sure what you meant by a Holder class that you mentioned in a previous e-mail. Would you care to go into details? -Mark >----- Original Message ----- >From: "Jon Lipsky" <jon...@xe...> > > > >>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.?.? >> >> |
From: Gavin K. <ga...@ap...> - 2002-10-19 04:39:56
|
> Gavin, I'm not really sure what you meant by a Holder class that you > mentioned in a previous e-mail. Would you care to go into details? I don't have a set idea of what we need here, except that: Use of java.sql.Clob class is non-useful, since it provides no way to update the data. setCharacterStream() / getCharacterStream() should therefore be the methods we use to interact with the JDBC PreparedStatement / ResultSet |
From: Gavin K. <ga...@ap...> - 2002-10-20 10:49:37
|
> >Use of java.sql.Clob class is non-useful, since it provides no way to > >update the data. > > > > In JDBC 3.0, which is in JDK 1.4, Clob has setAsciiStream, > setCharacterStream, setString and truncate methods to update data. Is > it reasonable to require that people use JDBC 3.0 if they want full > support for CLOB's? If we do this, we'd also have to provide an > implementation of java.sql.Clob. Ah. Cool. I wasn't aware of that. > What do you think about adding a hibernate.use_clobs property to decide > between the two? If true, then Clobs are used. Otherwise, use char[] > instead. Nah, it would be better to provide two different ClobTypes with different names, if necessary. Properties are best for specifying behaviour thats transparent to appplication code. |
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: Gavin K. <ga...@ap...> - 2002-10-17 18:20:52
|
I plan to do this when/if the packages get renamed to something other than cirrus.hibernate.*. For now, its very useful to have the full CVS history for the files...... ----- Original Message ----- From: "Max Rydahl Andersen" <ma...@eo...> To: <hib...@li...> Sent: Thursday, October 17, 2002 7:56 PM Subject: [Hibernate] Suggestion: move cirrus into a src directory > 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 > > > > ------------------------------------------------------- > 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: Max R. A. <ma...@eo...> - 2002-10-17 18:47:56
|
Ok, great :) 3 things... Where does the name cirrus actually come from ? (anything to do with cirrus logic ??) The full CVS history can actually be handled by physically moving the cirrus directory into a src directory on the actual cvs server (All the history is in the .v files, and CVS will just return all directories found in the root. (see http://www.gnu.org/manual/cvs-1.9/html_node/cvs_69.html for the gory details :) What may it be changed into instead ? net.sf.hibernate, or ? /max ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Max Rydahl Andersen" <ma...@eo...> Cc: "hibernate list" <hib...@li...> Sent: Thursday, October 17, 2002 8:19 PM Subject: Re: [Hibernate] Suggestion: move cirrus into a src directory > I plan to do this when/if the packages get renamed to something other than > cirrus.hibernate.*. For now, its very useful to have the full CVS history > for the files...... > > ----- Original Message ----- > From: "Max Rydahl Andersen" <ma...@eo...> > To: <hib...@li...> > Sent: Thursday, October 17, 2002 7:56 PM > Subject: [Hibernate] Suggestion: move cirrus into a src directory > > > > 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 > > > > > > > > ------------------------------------------------------- > > 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 18:54:32
|
> Where does the name cirrus actually come from ? (anything to do with cirrus > logic ??) My previous employer: http://cirrustech.com.au I ditched the ".com.au" bit because it seemed a bit parochial..... > The full CVS history can actually be handled by physically moving the cirrus > directory into a src directory on > the actual cvs server (All the history is in the .v files, and CVS will just > return all directories found in the root. > (see http://www.gnu.org/manual/cvs-1.9/html_node/cvs_69.html for the gory > details :) Yeah, unfortunately I don't have access to the actual CVS server ;) I could post a sourceforge support request, I suppose..... > What may it be changed into instead ? net.sf.hibernate, or ? Yeah maybe. I have been indecisive about this. Hence nothing has got done. If people start shouting at me loud enough with a particular suggestion, maybe that'll wake me out of this complacency ;) I must admit, "net.sf" don't sound so bad .... |