From: <one...@us...> - 2003-01-25 09:35:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv27891/sf/hibernate Modified Files: Hibernate.java Log Message: added createClob(), createBlob() for streams Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hibernate.java 5 Jan 2003 02:11:19 -0000 1.3 --- Hibernate.java 25 Jan 2003 09:35:52 -0000 1.4 *************** *** 2,8 **** package net.sf.hibernate; ! import net.sf.hibernate.proxy.HibernateProxy; ! import net.sf.hibernate.proxy.HibernateProxyHelper; ! import net.sf.hibernate.type.*; import java.io.Serializable; import java.sql.Blob; --- 2,7 ---- package net.sf.hibernate; ! import java.io.InputStream; ! import java.io.Reader; import java.io.Serializable; import java.sql.Blob; *************** *** 10,15 **** import java.sql.SQLException; - import net.sf.hibernate.cfg.*; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.collection.PersistentCollection; import net.sf.hibernate.impl.DatastoreImpl; --- 9,14 ---- import java.sql.SQLException; import net.sf.hibernate.cfg.Configuration; + import net.sf.hibernate.cfg.Datastore; import net.sf.hibernate.collection.PersistentCollection; import net.sf.hibernate.impl.DatastoreImpl; *************** *** 17,20 **** --- 16,52 ---- import net.sf.hibernate.lob.BlobImpl; import net.sf.hibernate.lob.ClobImpl; + import net.sf.hibernate.proxy.HibernateProxy; + import net.sf.hibernate.proxy.HibernateProxyHelper; + import net.sf.hibernate.type.BigDecimalType; + import net.sf.hibernate.type.BinaryType; + import net.sf.hibernate.type.BlobType; + import net.sf.hibernate.type.BooleanType; + import net.sf.hibernate.type.ByteType; + import net.sf.hibernate.type.CalendarDateType; + import net.sf.hibernate.type.CalendarType; + import net.sf.hibernate.type.CharacterType; + import net.sf.hibernate.type.ClassType; + import net.sf.hibernate.type.ClobType; + import net.sf.hibernate.type.CurrencyType; + import net.sf.hibernate.type.CustomType; + import net.sf.hibernate.type.DateType; + import net.sf.hibernate.type.DoubleType; + import net.sf.hibernate.type.FloatType; + import net.sf.hibernate.type.IntegerType; + import net.sf.hibernate.type.LocaleType; + import net.sf.hibernate.type.LongType; + import net.sf.hibernate.type.ManyToOneType; + import net.sf.hibernate.type.NullableType; + import net.sf.hibernate.type.ObjectType; + import net.sf.hibernate.type.PersistentEnumType; + import net.sf.hibernate.type.SerializableType; + import net.sf.hibernate.type.ShortType; + import net.sf.hibernate.type.StringType; + import net.sf.hibernate.type.TimeType; + import net.sf.hibernate.type.TimeZoneType; + import net.sf.hibernate.type.TimestampType; + import net.sf.hibernate.type.TrueFalseType; + import net.sf.hibernate.type.Type; + import net.sf.hibernate.type.YesNoType; /** *************** *** 219,222 **** --- 251,255 ---- * Create a new <tt>Blob</tt>. The returned object will be * initially immutable. + * @param bytes a byte array */ public static Blob createBlob(byte[] bytes) { *************** *** 225,233 **** --- 258,287 ---- /** + * Create a new <tt>Blob</tt>. The returned object will be + * initially immutable. + * @param stream a binary stream + * @param length the number of bytes in the stream + */ + public static Blob createBlob(InputStream stream, int length) { + return new BlobImpl(stream, length); + } + + /** * Create a new <tt>Clob</tt>. The returned object will be * initially immutable. + * @param string a <tt>String</tt> */ public static Clob createClob(String string) { return new ClobImpl(string); + } + + /** + * Create a new <tt>Clob</tt>. The returned object will be + * initially immutable. + * @param reader a character stream + * @param length the number of characters in the stream + */ + public static Clob createClob(Reader reader, int length) { + return new ClobImpl(reader, length); } } |