You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2002-12-15 10:46:43
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv30186/hibernate Modified Files: Session.java Transaction.java Log Message: added FlushMode API Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Session.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Session.java 14 Nov 2002 11:28:54 -0000 1.79 --- Session.java 15 Dec 2002 10:46:39 -0000 1.80 *************** *** 83,90 **** /** * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the connection and closing the ! * session. <i>Flushing</i> is the process of synchronising the ! * underlying persistent store with persistable state held in ! * memory. * * @throws SQLException --- 83,90 ---- /** * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the transaction and closing the ! * session (<tt>Transaction.commit()</tt> calls this method). <i>Flushing</i> ! * is the process of synchronising the underlying persistent store with ! * persistable state held in memory. * * @throws SQLException *************** *** 94,97 **** --- 94,113 ---- /** + * Set the flush mode. The flush mode determines at which points + * Hibernate automatically flushes the session. For a readonly + * session, it is reasonable to set the flush mode to + * <tt>FlushMode.NEVER</tt> at the start of the session (in + * order to achieve some extra performance). + * + * @see FlushMode + */ + public void setFlushMode(FlushMode flushMode); + + /** + * Get the current flush mode. + */ + public FlushMode getFlushMode(); + + /** * Get the JDBC connection. Applications are responsible for * calling commit/rollback upon the connection before closing *************** *** 402,407 **** /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. A filter ! * is a Hibernate query that may refer to <tt>this</tt>, the collection element. * * @param collection a persistent collection to filter --- 418,423 ---- /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. ! * A filter is a Hibernate query that may refer to <tt>this</tt>, the collection element. * * @param collection a persistent collection to filter *************** *** 480,500 **** /** - * Postpone execution of all SQL inserts, deletes and updates until <tt>flush()</tt> - * is explicitly called by the application. The default behaviour is to flush before - * execution of a query whose results may be affected by persistent state changes - * cached by the <tt>Session</tt>. After this method is called, query results may not - * be consistent with state held in memory. - * @see Session#resumeFlushes() - */ - public void suspendFlushes(); - - /** - * Resume the default behaviour, which is to flush SQL statements before execution of - * a query whose results may be affected by persistent state changes cached in memory. - * @see Session#suspendFlushes() - */ - public void resumeFlushes(); - - /** * Create a new instance of <tt>Query</tt> for the given query string. * --- 496,499 ---- *************** *** 527,530 **** --- 526,550 ---- //DEPRECATED: + /** + * Postpone execution of all SQL inserts, deletes and updates until <tt>flush()</tt> + * is explicitly called by the application. The default behaviour is to flush before + * execution of a query whose results may be affected by persistent state changes + * cached by the <tt>Session</tt>. After this method is called, query results may not + * be consistent with state held in memory. + * + * @deprecated use <tt>setFlushMode(FlushMode.COMMIT)</tt> + * @see Session#resumeFlushes() + */ + public void suspendFlushes(); + + /** + * Resume the default behaviour, which is to flush SQL statements before execution of + * a query whose results may be affected by persistent state changes cached in memory. + * + * @deprecated use <tt>setFlushMode(FlushMode.AUTO)</tt> + * @see Session#suspendFlushes() + */ + public void resumeFlushes(); + /** * Execute a query, returning only the identifiers. Index: Transaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Transaction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Transaction.java 10 Jun 2002 09:42:27 -0000 1.5 --- Transaction.java 15 Dec 2002 10:46:39 -0000 1.6 *************** *** 11,18 **** * A transaction is associated with a <tt>Session</tt> and is * usually instantiated by a call to <tt>Session.beginTransaction()</tt>. ! * However, a single session might span multiple transactions since * the notion of a session (a conversation between the application * and the datastore) is of coarser granularity than the notion of ! * a transaction.<br> * <br> * Implementors are not intended to be threadsafe. --- 11,20 ---- * A transaction is associated with a <tt>Session</tt> and is * usually instantiated by a call to <tt>Session.beginTransaction()</tt>. ! * A single session might span multiple transactions since * the notion of a session (a conversation between the application * and the datastore) is of coarser granularity than the notion of ! * a transaction. However, it is intended that there be at most one ! * uncommitted <tt>Transaction</tt> associated with a particular ! * <tt>Session</tt> at any time.<br> * <br> * Implementors are not intended to be threadsafe. |
From: <one...@us...> - 2002-12-15 07:38:04
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv13719 Modified Files: changelog.txt Log Message: latest changes Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.286 retrieving revision 1.287 diff -C2 -d -r1.286 -r1.287 *** changelog.txt 8 Dec 2002 06:02:44 -0000 1.286 --- changelog.txt 15 Dec 2002 07:38:01 -0000 1.287 *************** *** 1,4 **** --- 1,13 ---- Hibernate Changelog =================== + Changes in version 1.2.1 (xx.12.2002) + ------------------------------------- + * Changed the MySQL mapping of Hibernate "timestamp" to MySQL "DATETIME" (Matthias Schwinn) + * TransactionManagerLookup classes now define defaut UserTransaction JNDI names + * support for WebSphere 5 (Venkat Srinivasan) + * fixed a bug with query expressions of the form "foo.bar.id" for normalized mappings + * experimental Blob/Clob support (Benoit Menendez) + * improvements to SchemaUpdater (Benoit Menendez) + Changes in version 1.2 final (7.12.2002) ---------------------------------------- |
From: <one...@us...> - 2002-12-15 07:27:40
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map In directory sc8-pr-cvs1:/tmp/cvs-serv5753/hibernate/map Modified Files: Collection.java Column.java Table.java Value.java Log Message: shorter name generation for indexes / foreign keys (needed for DB2) Index: Collection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Collection.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Collection.java 14 Dec 2002 09:27:55 -0000 1.50 --- Collection.java 15 Dec 2002 07:27:37 -0000 1.51 *************** *** 209,214 **** } public Index createIndex() { ! int indexID = table.generateConstraintID(getKey().getColumnIterator()); ! String name = StringHelper.suffix(table.getQualifiedName(), "IDX" + Integer.toHexString(indexID).toUpperCase()); Index index = table.getIndex(name); Iterator iter = getKey().getColumnIterator(); --- 209,213 ---- } public Index createIndex() { ! String name = "IX" + table.uniqueColumnString( getKey().getColumnIterator() ); Index index = table.getIndex(name); Iterator iter = getKey().getColumnIterator(); Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Column.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Column.java 14 Dec 2002 09:27:55 -0000 1.21 --- Column.java 15 Dec 2002 07:27:38 -0000 1.22 *************** *** 79,83 **** catch (Exception e) { throw new MappingException( ! "Could not determine type for column " + name + " of type " + type.getClass().getName() + ": " + e.getClass().getName(), e ); } } --- 79,85 ---- catch (Exception e) { throw new MappingException( ! "Could not determine type for column " + name + " of type " + type.getClass().getName() + ": " + e.getClass().getName(), ! e ! ); } } *************** *** 92,102 **** } ! public boolean equals(Object object) ! { ! return object instanceof Column && equals((Column)object); } ! public boolean equals(Column column) ! { if (null == column) return false; if (this == column) return true; --- 94,102 ---- } ! public boolean equals(Object object) { ! return object instanceof Column && equals( (Column) object ); } ! public boolean equals(Column column) { if (null == column) return false; if (this == column) return true; *************** *** 105,110 **** } ! public int hashCode() ! { return name.hashCode(); } --- 105,109 ---- } ! public int hashCode() { return name.hashCode(); } Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Table.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Table.java 14 Dec 2002 09:27:55 -0000 1.31 --- Table.java 15 Dec 2002 07:27:38 -0000 1.32 *************** *** 211,220 **** } ! public int generateConstraintID(Iterator iterator) { int result = 0; ! ! while (iterator.hasNext()) result += iterator.next().hashCode(); ! ! return result; } --- 211,218 ---- } ! public String uniqueColumnString(Iterator iterator) { int result = 0; ! while ( iterator.hasNext() ) result += iterator.next().hashCode(); ! return ( Integer.toHexString( name.hashCode() ) + Integer.toHexString(result) ).toUpperCase(); } Index: Value.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Value.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Value.java 14 Dec 2002 09:27:55 -0000 1.42 --- Value.java 15 Dec 2002 07:27:38 -0000 1.43 *************** *** 7,11 **** import cirrus.hibernate.*; import cirrus.hibernate.helpers.ReflectHelper; - import cirrus.hibernate.helpers.StringHelper; import cirrus.hibernate.id.Assigned; import cirrus.hibernate.id.IdentifierGenerator; --- 7,10 ---- *************** *** 106,111 **** public void createForeignKeyOfClass(Root root, Table table, Class persistentClass) { //foreign key ! int keyID = table.generateConstraintID(getConstraintColumnIterator()); ! String name = StringHelper.suffix(table.getName(), "FK" + Integer.toHexString(keyID).toUpperCase()); ForeignKey fk = table.getForeignKey(name); Iterator iter = getConstraintColumnIterator(); --- 105,109 ---- public void createForeignKeyOfClass(Root root, Table table, Class persistentClass) { //foreign key ! String name = "FK" + table.uniqueColumnString( getConstraintColumnIterator() ); ForeignKey fk = table.getForeignKey(name); Iterator iter = getConstraintColumnIterator(); |
From: <one...@us...> - 2002-12-15 07:27:40
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv5753/hibernate Modified Files: Datastore.java Log Message: shorter name generation for indexes / foreign keys (needed for DB2) Index: Datastore.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Datastore.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Datastore.java 14 Dec 2002 09:27:55 -0000 1.32 --- Datastore.java 15 Dec 2002 07:27:37 -0000 1.33 *************** *** 131,135 **** will be assumed to be mapping documents. ! @param resource the .jar file @return Datastore @throws MappingException --- 131,135 ---- will be assumed to be mapping documents. ! @param resource the <tt>.jar</tt> file @return Datastore @throws MappingException *************** *** 139,143 **** /** Generates a list of SQL statements that may be used to create the tables ! needed by this Datastore. @param dialect the script SQL dialect --- 139,143 ---- /** Generates a list of SQL statements that may be used to create the tables ! needed by this <tt>Datastore</tt>. @param dialect the script SQL dialect *************** *** 148,152 **** /** Generates a list of SQL statements that may be used to drop the tables ! needed by this Datastore. @param dialect the script SQL dialect --- 148,152 ---- /** Generates a list of SQL statements that may be used to drop the tables ! needed by this <tt>Datastore</tt>. @param dialect the script SQL dialect |
From: <one...@us...> - 2002-12-15 05:12:43
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv26052/impl Modified Files: ScrollableResultsImpl.java Log Message: added getClob() Index: ScrollableResultsImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/ScrollableResultsImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ScrollableResultsImpl.java 14 Dec 2002 09:27:55 -0000 1.8 --- ScrollableResultsImpl.java 15 Dec 2002 05:12:41 -0000 1.9 *************** *** 3,6 **** --- 3,8 ---- import java.math.BigDecimal; + import java.sql.Blob; + import java.sql.Clob; import java.sql.ResultSet; import java.sql.SQLException; *************** *** 115,120 **** * @see cirrus.hibernate.ScrollableResults#getBlob(int) */ ! public java.sql.Blob getBlob(int col) throws SQLException, HibernateException { ! return (java.sql.Blob) get(col); } --- 117,129 ---- * @see cirrus.hibernate.ScrollableResults#getBlob(int) */ ! public Blob getBlob(int col) throws SQLException, HibernateException { ! return (Blob) get(col); ! } ! ! /** ! * @see cirrus.hibernate.ScrollableResults#getClob(int) ! */ ! public Clob getClob(int col) throws SQLException, HibernateException { ! return (Clob) get(col); } |
From: <one...@us...> - 2002-12-15 05:12:43
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv26052 Modified Files: Environment.java ScrollableResults.java Log Message: added getClob() Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Environment.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Environment.java 30 Nov 2002 08:18:59 -0000 1.78 --- Environment.java 15 Dec 2002 05:12:40 -0000 1.79 *************** *** 39,43 **** public final class Environment { ! private static final String VERSION = "1.2 final"; /** --- 39,43 ---- public final class Environment { ! private static final String VERSION = "1.2.1"; /** Index: ScrollableResults.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/ScrollableResults.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ScrollableResults.java 14 Dec 2002 09:27:55 -0000 1.7 --- ScrollableResults.java 15 Dec 2002 05:12:41 -0000 1.8 *************** *** 3,6 **** --- 3,8 ---- import java.math.BigDecimal; + import java.sql.Blob; + import java.sql.Clob; import java.sql.SQLException; import java.util.Calendar; *************** *** 88,156 **** /** ! * Convenience method to read an integer */ public Integer getInteger(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a long */ public Long getLong(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a float */ public Float getFloat(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a boolean */ public Boolean getBoolean(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a double */ public Double getDouble(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a short */ public Short getShort(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a byte */ public Byte getByte(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a character */ public Character getCharacter(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a binary */ public byte[] getBinary(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a blob */ ! public java.sql.Blob getBlob(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a string */ public String getString(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a big_decimal */ public BigDecimal getBigDecimal(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a date, time or timestamp */ public Date getDate(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a locale */ public Locale getLocale(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a calendar or calendar date */ public Calendar getCalendar(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a currency */ //public Currency getCurrency(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a timezone */ public TimeZone getTimeZone(int col) throws SQLException, HibernateException; --- 90,162 ---- /** ! * Convenience method to read an <tt>integer</tt> */ public Integer getInteger(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>long</tt> */ public Long getLong(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>float</tt> */ public Float getFloat(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>boolean</tt> */ public Boolean getBoolean(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>double</tt> */ public Double getDouble(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>short</tt> */ public Short getShort(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>byte</tt> */ public Byte getByte(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>character</tt> */ public Character getCharacter(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>binary</tt> */ public byte[] getBinary(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>blob</tt> */ ! public Blob getBlob(int col) throws SQLException, HibernateException; ! /** ! * Convenience method to read a <tt>clob</tt> ! */ ! public Clob getClob(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>string</tt> */ public String getString(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>big_decimal</tt> */ public BigDecimal getBigDecimal(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>date</tt>, <tt>time</tt> or <tt>timestamp</tt> */ public Date getDate(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>locale</tt> */ public Locale getLocale(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>calendar</tt> or <tt>calendar_date</tt> */ public Calendar getCalendar(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>currency</tt> */ //public Currency getCurrency(int col) throws SQLException, HibernateException; /** ! * Convenience method to read a <tt>timezone</tt> */ public TimeZone getTimeZone(int col) throws SQLException, HibernateException; |
From: <one...@us...> - 2002-12-15 04:54:44
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv9926/test Modified Files: MultiTableTest.java Log Message: fixed a bug parsing expressions like foo.bar.id for normalized table mappings Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MultiTableTest.java 26 Nov 2002 08:37:26 -0000 1.14 --- MultiTableTest.java 15 Dec 2002 04:54:41 -0000 1.15 *************** *** 94,97 **** --- 94,98 ---- s.find("from m in class Simple where m.count>0 and m.name is not null"); s.find("from m in class LessSimple where m.other is not null"); + s.find("from m in class Multi where m.other.id = 1"); s.find("from m in class SubMulti where m.amount > 0.0"); |
From: <one...@us...> - 2002-12-15 04:54:44
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv9926/persister Modified Files: MultiTableEntityPersister.java Log Message: fixed a bug parsing expressions like foo.bar.id for normalized table mappings Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** MultiTableEntityPersister.java 27 Nov 2002 16:42:55 -0000 1.41 --- MultiTableEntityPersister.java 15 Dec 2002 04:54:41 -0000 1.42 *************** *** 115,122 **** --- 115,124 ---- EntityType etype = (EntityType) type; Type idType = factory.getIdentifierType( etype.getPersistentClass() ); + Object table = tableNumberByPropertyPath.get(path); String idpath = path + '.' + PathExpressionParser.ENTITY_ID; mods.put(idpath, idType); columnNamesByPropertyPath.put(idpath, columns); + tableNumberByPropertyPath.put(idpath, table); if ( idType.isComponentType() ) { AbstractComponentType actype = (AbstractComponentType) idType; *************** *** 125,128 **** --- 127,131 ---- String subidpath = idpath + '.' + props[i]; columnNamesByPropertyPath.put( subidpath, new String[] { columns[i] } ); + tableNumberByPropertyPath.put(subidpath, table); mods.put( subidpath, actype.getSubtypes()[i] ); } |
From: <one...@us...> - 2002-12-14 09:27:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv888/type Modified Files: TypeFactory.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: TypeFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TypeFactory.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TypeFactory.java 21 Nov 2002 09:03:14 -0000 1.22 --- TypeFactory.java 14 Dec 2002 09:27:56 -0000 1.23 *************** *** 4,7 **** --- 4,9 ---- import java.io.Serializable; import java.math.BigDecimal; + import java.sql.Blob; + import java.sql.Clob; import java.sql.Time; import java.sql.Timestamp; *************** *** 53,56 **** --- 55,60 ---- basics.put( Hibernate.YES_NO.getName(), Hibernate.YES_NO); basics.put( Hibernate.BINARY.getName(), Hibernate.BINARY); + basics.put( Hibernate.BLOB.getName(), Hibernate.BLOB); + basics.put( Hibernate.CLOB.getName(), Hibernate.CLOB); basics.put( Hibernate.BIG_DECIMAL.getName(), Hibernate.BIG_DECIMAL); basics.put( Hibernate.SERIALIZABLE.getName(), Hibernate.SERIALIZABLE); *************** *** 77,80 **** --- 81,86 ---- basics.put( Class.class.getName(), Hibernate.CLASS); basics.put( byte[].class.getName(), Hibernate.BINARY); + basics.put( Blob.class.getName(), Hibernate.BLOB); + basics.put( Clob.class.getName(), Hibernate.CLOB); basics.put( Serializable.class.getName(), Hibernate.SERIALIZABLE); basicTypes = Collections.unmodifiableMap(basics); |
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/updater In directory sc8-pr-cvs1:/tmp/cvs-serv888/tools/updater Added Files: JdbcColumnInfo.java JdbcDatabaseInfo.java JdbcForeignKeyInfo.java JdbcIndexInfo.java JdbcTableInfo.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support --- NEW FILE: JdbcColumnInfo.java --- //$Id: JdbcColumnInfo.java,v 1.1 2002/12/14 09:27:56 oneovthafew Exp $ package cirrus.hibernate.tools.updater; import java.sql.ResultSet; import java.sql.SQLException; /* * Created by IntelliJ IDEA. * User: Administrator * Date: 13.10.2002 * Time: 21:04:35 * (C) 2002 Christoph Sturm */ public class JdbcColumnInfo { private final String _name; private final String _typeName; private final int _columnSize; private final int _decimalDigits; private final String _isNullable; public JdbcColumnInfo(ResultSet rs) throws SQLException { _name = rs.getString("COLUMN_NAME"); _typeName = rs.getString("TYPE_NAME"); _columnSize = rs.getInt("COLUMN_SIZE"); _decimalDigits = rs.getInt("DECIMAL_DIGITS"); _isNullable = rs.getString("IS_NULLABLE"); } public String getName() { return _name; } public String getTypeName() { return _typeName; } public int getColumnSize() { return _columnSize; } public int getDecimalDigits() { return _decimalDigits; } public String getNullable() { return _isNullable; } public String toString() { return _name; } } --- NEW FILE: JdbcDatabaseInfo.java --- //$Id: JdbcDatabaseInfo.java,v 1.1 2002/12/14 09:27:56 oneovthafew Exp $ package cirrus.hibernate.tools.updater; import java.sql.*; import java.util.*; import cirrus.hibernate.sql.Dialect; public class JdbcDatabaseInfo { private final Map _tables = new HashMap(); private final Set _sequences = new HashSet(); public JdbcDatabaseInfo(Connection connection, Dialect dialect) throws SQLException { DatabaseMetaData meta = connection.getMetaData(); initTables(meta); initColumns(meta); initForeignKeys(meta); initIndexes(meta); initSequences(connection, dialect); } public JdbcTableInfo getTableInfo(String name) { return name != null ? (JdbcTableInfo)_tables.get(name.toUpperCase()) : null; } private void initTables(DatabaseMetaData meta) throws SQLException { ResultSet rs = null; try { String[] types = {"TABLE"}; rs = meta.getTables(null, "%", "%", types); while (rs.next()) addTable(rs); } finally { if (rs != null) rs.close(); } } private void addTable(ResultSet rs) throws SQLException { String name = rs.getString("TABLE_NAME"); if (name == null) return; if (getTableInfo(name) == null) { JdbcTableInfo info = new JdbcTableInfo(rs); _tables.put(info.getName().toUpperCase(), info); } } private void initColumns(DatabaseMetaData meta) throws SQLException { ResultSet rs = null; try { rs = meta.getColumns(null, "%", "%", "%"); while (rs.next()) { JdbcTableInfo info = getTableInfo(rs.getString("TABLE_NAME")); if (info == null) continue; info.addColumn(rs); } } finally { if (rs != null) rs.close(); } } private void initForeignKeys(DatabaseMetaData meta) throws SQLException { Iterator iterator = _tables.values().iterator(); while (iterator.hasNext()) { JdbcTableInfo info = (JdbcTableInfo)iterator.next(); info.initForeignKeys(meta); } } private void initIndexes(DatabaseMetaData meta) throws SQLException { Iterator iterator = _tables.values().iterator(); while (iterator.hasNext()) { JdbcTableInfo info = (JdbcTableInfo)iterator.next(); info.initIndexes(meta); } } private void initSequences(Connection connection, Dialect dialect) throws SQLException { String sql = dialect.getQuerySequencesString(); if (sql == null) return; Statement statement = null; ResultSet rs = null; try { statement = connection.createStatement(); rs = statement.executeQuery(sql); while (rs.next()) _sequences.add(rs.getString(1).toUpperCase()); } finally { if (rs != null) rs.close(); if (statement != null) statement.close(); } } public boolean isSequence(Object key) { return key instanceof String && _sequences.contains(((String)key).toUpperCase()); } } --- NEW FILE: JdbcForeignKeyInfo.java --- //$Id: JdbcForeignKeyInfo.java,v 1.1 2002/12/14 09:27:56 oneovthafew Exp $ package cirrus.hibernate.tools.updater; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public class JdbcForeignKeyInfo { private final String _name; private final List _columns = new ArrayList(); public JdbcForeignKeyInfo(ResultSet rs) throws SQLException { _name = rs.getString("FK_NAME"); } public String getName() { return _name; } public void addColumn(JdbcColumnInfo column) { if (column != null) _columns.add(column); } public List getColumns() { return _columns; } public String toString() { return _name; } } --- NEW FILE: JdbcIndexInfo.java --- //$Id: JdbcIndexInfo.java,v 1.1 2002/12/14 09:27:56 oneovthafew Exp $ package cirrus.hibernate.tools.updater; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public class JdbcIndexInfo { private final String _name; private final List _columns = new ArrayList(); public JdbcIndexInfo(ResultSet rs) throws SQLException { _name = rs.getString("INDEX_NAME"); } public String getName() { return _name; } public void addColumn(JdbcColumnInfo column) { if (column != null) _columns.add(column); } public List getColumns() { return _columns; } public String toString() { return _name; } } --- NEW FILE: JdbcTableInfo.java --- //$Id: JdbcTableInfo.java,v 1.1 2002/12/14 09:27:56 oneovthafew Exp $ package cirrus.hibernate.tools.updater; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; public class JdbcTableInfo { private final String _schema; private final String _name; private final Map _columns = new HashMap(); private final Map _foreignKeys = new HashMap(); private final Map _indexes = new HashMap(); public JdbcTableInfo(ResultSet rs) throws SQLException { _schema = rs.getString("TABLE_SCHEM"); _name = rs.getString("TABLE_NAME"); } public void initForeignKeys(DatabaseMetaData meta) throws SQLException { ResultSet rs = null; try { rs = meta.getImportedKeys(null, _schema, _name); while (rs.next()) addForeignKey(rs); } finally { if (rs != null) rs.close(); } } public void initIndexes(DatabaseMetaData meta) throws SQLException { ResultSet rs = null; try { rs = meta.getIndexInfo(null, _schema, _name, false, true); while (rs.next()) { if (rs.getShort("TYPE") == DatabaseMetaData.tableIndexStatistic) continue; addIndex(rs); } } finally { if (rs != null) rs.close(); } } public JdbcColumnInfo getColumnInfo(String name) { return (JdbcColumnInfo)_columns.get(name.toLowerCase()); } public void addColumn(ResultSet rs) throws SQLException { String name = rs.getString("COLUMN_NAME"); if (name == null) return; if (getColumnInfo(name) == null) { JdbcColumnInfo info = new JdbcColumnInfo(rs); _columns.put(info.getName().toLowerCase(), info); } } public JdbcForeignKeyInfo getForeignKeyInfo(String name) { return (JdbcForeignKeyInfo)_foreignKeys.get(name.toUpperCase()); } private void addForeignKey(ResultSet rs) throws SQLException { String name = rs.getString("FK_NAME"); if (name == null) return; JdbcForeignKeyInfo info = getForeignKeyInfo(name); if (info == null) { info = new JdbcForeignKeyInfo(rs); _foreignKeys.put(info.getName().toUpperCase(), info); } info.addColumn(getColumnInfo("FKCOLUMN_NAME")); } public JdbcIndexInfo getIndexInfo(String name) { return (JdbcIndexInfo)_indexes.get(name.toUpperCase()); } private void addIndex(ResultSet rs) throws SQLException { String name = rs.getString("INDEX_NAME"); if (name == null) return; JdbcIndexInfo info = getIndexInfo(name); if (info == null) { info = new JdbcIndexInfo(rs); _indexes.put(info.getName().toUpperCase(), info); } info.addColumn(getColumnInfo("COLUMN_NAME")); } public String getName() { return _name; } public String toString() { return _name; } } |
From: <one...@us...> - 2002-12-14 09:27:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect In directory sc8-pr-cvs1:/tmp/cvs-serv888/tools/reflect Modified Files: ReflectedProperty.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: ReflectedProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/ReflectedProperty.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ReflectedProperty.java 26 Nov 2002 03:35:45 -0000 1.17 --- ReflectedProperty.java 14 Dec 2002 09:27:56 -0000 1.18 *************** *** 2,5 **** --- 2,7 ---- import java.math.BigDecimal; + import java.sql.Blob; + import java.sql.Clob; import java.sql.Time; import java.sql.Timestamp; *************** *** 52,56 **** shortTypeNames.put( java.util.Date.class.getName(), Hibernate.TIMESTAMP.getName() ); shortTypeNames.put( java.sql.Date.class.getName(), Hibernate.DATE.getName() ); ! shortTypeNames.put( byte[].class.getName(), Hibernate.BINARY.getName() ); // not shorter, but nicer } --- 54,60 ---- shortTypeNames.put( java.util.Date.class.getName(), Hibernate.TIMESTAMP.getName() ); shortTypeNames.put( java.sql.Date.class.getName(), Hibernate.DATE.getName() ); ! shortTypeNames.put( byte[].class.getName(), Hibernate.BINARY.getName() ); // not shorter, but nicer ! shortTypeNames.put( Blob.class.getName(), Hibernate.BLOB.getName() ); ! shortTypeNames.put( Clob.class.getName(), Hibernate.CLOB.getName() ); } |
From: <one...@us...> - 2002-12-14 09:27:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools In directory sc8-pr-cvs1:/tmp/cvs-serv888/tools Modified Files: SchemaUpdater.java Removed Files: JdbcColumnInfo.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: SchemaUpdater.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/SchemaUpdater.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SchemaUpdater.java 11 Nov 2002 10:09:56 -0000 1.2 --- SchemaUpdater.java 14 Dec 2002 09:27:56 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import cirrus.hibernate.HibernateException; import cirrus.hibernate.sql.Dialect; + import cirrus.hibernate.tools.updater.*; import cirrus.hibernate.connection.ConnectionProvider; import cirrus.hibernate.connection.ConnectionProviderFactory; *************** *** 78,83 **** public void execute(boolean script) throws SQLException, HibernateException { Connection connection = cp.getConnection(); ! Map columnInfo = getColumnInfo(connection); Statement stmt; stmt = connection.createStatement(); --- 79,85 ---- public void execute(boolean script) throws SQLException, HibernateException { + Dialect dialect = Dialect.getDialect(); Connection connection = cp.getConnection(); ! JdbcDatabaseInfo info = new JdbcDatabaseInfo(connection, dialect); Statement stmt; stmt = connection.createStatement(); *************** *** 86,90 **** String[] createSQL; ! createSQL = store.generateSchemaUpdateScript(Dialect.getDialect(), columnInfo); for (int j = 0; j < createSQL.length; j++) { --- 88,92 ---- String[] createSQL; ! createSQL = store.generateSchemaUpdateScript(dialect, info); for (int j = 0; j < createSQL.length; j++) { *************** *** 110,239 **** connection.close(); } - - - // the next 2 functions are highly inspired by the ofbiz entity engine - - private Map getColumnInfo(Connection connection) { - - - DatabaseMetaData dbData = null; - - try { - dbData = connection.getMetaData(); - } catch (SQLException sqle) { - String message = "Unable to get database meta data... Error was:" + sqle.toString(); - - log.error(message); - - } - - - log.info("Getting Column Info From Database"); - - Map colInfo = new HashMap(); - - try { - String userName = dbData.supportsSchemasInTableDefinitions() ? dbData.getUserName() : null; - if (userName!=null) log.info("Schema: " + userName); - //ResultSet rsCols = dbData.getColumns(null, userName, "%", "%"); - ResultSet rsCols = dbData.getColumns(null, "%", "%", "%"); - - while (rsCols.next()) { - try { - JdbcColumnInfo info = new JdbcColumnInfo(); - - info.table = rsCols.getString("TABLE_NAME"); - info.table = (info.table == null) ? null : info.table.toUpperCase(); - - info.columnName = rsCols.getString("COLUMN_NAME"); - - info.typeName = rsCols.getString("TYPE_NAME"); - info.columnSize = rsCols.getInt("COLUMN_SIZE"); - info.decimalDigits = rsCols.getInt("DECIMAL_DIGITS"); - - info.isNullable = rsCols.getString("IS_NULLABLE"); - - log.info("Existing column: " + info); - - Map tableColInfo = (Map)colInfo.get(info.table.toLowerCase()); - - if (tableColInfo == null) { - tableColInfo = new HashMap(); - colInfo.put(info.table.toLowerCase(), tableColInfo); - } - tableColInfo.put( info.columnName.toLowerCase(), info ); - } catch (SQLException sqlex) { - String messagex = "Error getting column info for column. Error was:" + sqlex.toString(); - - log.debug(messagex); - continue; - } - } - - try { - rsCols.close(); - } catch (SQLException sqle) { - String message = "Unable to close ResultSet for column list, continuing anyway... Error was:" + sqle.toString(); - - log.error(message); - } - } catch (SQLException sqle) { - String message = "Error getting column meta data for Error was:" + sqle.toString() + ". Not checking columns."; - - log.error(message); - } - return colInfo; - } - - private Set getTableNames(Connection connection) throws SQLException { - - DatabaseMetaData dbData = connection.getMetaData(); - - log.info("Getting Table Info From Database"); - - Set tableNames = new TreeSet(); - ResultSet tableSet; - try { - String[] types = {"TABLE"}; - String userName = dbData.supportsSchemasInTableDefinitions() ? dbData.getUserName() : null; - - tableSet = dbData.getTables(null, userName, null, types); - } catch (SQLException sqle) { - - log.error("Unable to get list of table information, trying to create all tables.", sqle); - - // we are returning an empty set here because databases like SapDB throw an exception when there are no tables in the database - return tableNames; - } - - try { - while (tableSet.next()) { - try { - String tableName = tableSet.getString("TABLE_NAME"); - log.debug("Found Table:" + tableName); - tableNames.add(tableName); - - log.info("Existing table: " + tableName); - - } catch (SQLException sqle) { - - log.error("Error getting table information... Error was:", sqle); - continue; - } - } - } catch (SQLException sqle) { - log.error("Error in tableSet.next(). Error was:" , sqle); - } finally { - try { - tableSet.close(); - } catch (SQLException sqle) { - String message = "Unable to close ResultSet for table list, continuing anyway... Error was:" + sqle.toString(); - - log.error(message); - } - } - return tableNames; - } - - } --- 112,114 ---- --- JdbcColumnInfo.java DELETED --- |
From: <one...@us...> - 2002-12-14 09:27:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv888/sql Modified Files: DB2Dialect.java Dialect.java SAPDBDialect.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: DB2Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/DB2Dialect.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DB2Dialect.java 25 Oct 2002 14:37:58 -0000 1.25 --- DB2Dialect.java 14 Dec 2002 09:27:55 -0000 1.26 *************** *** 27,30 **** --- 27,32 ---- register( Types.VARBINARY, "VARCHAR($l) FOR BIT DATA" ); register( Types.NUMERIC, "NUMERIC(19, $l)" ); + register( Types.BLOB, "BLOB($l)" ); + register( Types.CLOB, "CLOB($l)" ); getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); Index: Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/Dialect.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Dialect.java 27 Nov 2002 16:42:56 -0000 1.41 --- Dialect.java 14 Dec 2002 09:27:55 -0000 1.42 *************** *** 256,259 **** --- 256,262 ---- throw new MappingException("Dialect does not support sequences"); } + public String getQuerySequencesString() { + return null; + } /** Index: SAPDBDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/SAPDBDialect.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SAPDBDialect.java 25 Oct 2002 14:37:58 -0000 1.11 --- SAPDBDialect.java 14 Dec 2002 09:27:56 -0000 1.12 *************** *** 88,91 **** --- 88,96 ---- } + public String getQuerySequencesString() + { + return "select SEQUENCE_NAME from DOMAIN.SEQUENCES"; + } + public OuterJoinGenerator getOuterJoinGenerator() { return outerJoinGenerator; |
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map In directory sc8-pr-cvs1:/tmp/cvs-serv888/map Modified Files: Collection.java Column.java Constraint.java Index.java Root.java RootClass.java Subclass.java Table.java Value.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: Collection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Collection.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Collection.java 26 Nov 2002 03:35:42 -0000 1.49 --- Collection.java 14 Dec 2002 09:27:55 -0000 1.50 *************** *** 110,117 **** Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! table = new Table(); ! table.setName(tableName); ! table.setSchema(schema); ! if (!readonly) root.addTable(table); } //LAZINESS --- 110,114 ---- Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! table = root.addTable(schema, tableName); } //LAZINESS *************** *** 170,177 **** if (!toplevel) key.createForeignKeyOfClass( root, table, owner.getPersistentClass() ); // no foreign key for a toplevel - - if ( !isIndexed() ) root.addIndex( createIndex() ); } doneSecondPass=true; } --- 167,174 ---- if (!toplevel) key.createForeignKeyOfClass( root, table, owner.getPersistentClass() ); // no foreign key for a toplevel } + if (!isIndexed()) createIndex(); + doneSecondPass=true; } *************** *** 195,199 **** return false; } ! public boolean isArray() { return false; } --- 192,197 ---- return false; } ! ! public boolean isArray() { return false; } *************** *** 211,221 **** } public Index createIndex() { ! Index index = new Index(); ! index.setName( StringHelper.suffix( table.getQualifiedName(), "IDX" + table.generateConstraintID() ) ); ! index.setTable(table); Iterator iter = getKey().getColumnIterator(); ! while ( iter.hasNext() ) { ! index.addColumn( (Column) iter.next() ); ! } return index; } --- 209,217 ---- } public Index createIndex() { ! int indexID = table.generateConstraintID(getKey().getColumnIterator()); ! String name = StringHelper.suffix(table.getQualifiedName(), "IDX" + Integer.toHexString(indexID).toUpperCase()); ! Index index = table.getIndex(name); Iterator iter = getKey().getColumnIterator(); ! while (iter.hasNext()) index.addColumn((Column)iter.next()); return index; } Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Column.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Column.java 26 Nov 2002 03:35:43 -0000 1.20 --- Column.java 14 Dec 2002 09:27:55 -0000 1.21 *************** *** 72,76 **** this.typeIndex = typeIndex; } ! public int getSQLType(Mapping pi) throws MappingException { try { return getType().sqlTypes(pi)[ getTypeIndex() ]; --- 72,77 ---- this.typeIndex = typeIndex; } ! ! public int getSQLType(Mapping pi) throws MappingException { try { return getType().sqlTypes(pi)[ getTypeIndex() ]; *************** *** 91,94 **** } ! } --- 92,111 ---- } ! public boolean equals(Object object) ! { ! return object instanceof Column && equals((Column)object); ! } + public boolean equals(Column column) + { + if (null == column) return false; + if (this == column) return true; + + return name.equals(column.name); + } + + public int hashCode() + { + return name.hashCode(); + } + } \ No newline at end of file Index: Constraint.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Constraint.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Constraint.java 26 Nov 2002 03:35:43 -0000 1.9 --- Constraint.java 14 Dec 2002 09:27:55 -0000 1.10 *************** *** 21,25 **** } public void addColumn(Column column) { ! this.columns.add(column); } public int getColumnSpan() { --- 21,25 ---- } public void addColumn(Column column) { ! if (!columns.contains(column)) columns.add(column); } public int getColumnSpan() { *************** *** 35,39 **** this.table = table; } ! public String sqlDropString(Dialect dialect) { return "alter table " + getTable().getQualifiedName() + " drop constraint " + getName(); } --- 35,40 ---- this.table = table; } ! ! public String sqlDropString(Dialect dialect) { return "alter table " + getTable().getQualifiedName() + " drop constraint " + getName(); } Index: Index.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Index.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Index.java 26 Nov 2002 03:35:43 -0000 1.5 --- Index.java 14 Dec 2002 09:27:55 -0000 1.6 *************** *** 42,46 **** } public void addColumn(Column column) { ! this.columns.add(column); } public String getName() { --- 42,46 ---- } public void addColumn(Column column) { ! if (!columns.contains(column)) columns.add(column); } public String getName() { Index: Root.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Root.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Root.java 27 Oct 2002 03:11:33 -0000 1.35 --- Root.java 14 Dec 2002 09:27:55 -0000 1.36 *************** *** 33,45 **** private final java.util.Map classes; private final java.util.Map collections; ! private final java.util.List tables; ! private final java.util.List primaryKeys; ! private final java.util.List foreignKeys; ! private final java.util.List indexes; private final java.util.Map queries; private final java.util.Map generators; private final String schemaName; private final String defaultCascade; - private final java.util.Map indexLookup = new HashMap(); private static final String[] NO_STRINGS = {}; --- 33,41 ---- private final java.util.Map classes; private final java.util.Map collections; ! private final java.util.Map tables; private final java.util.Map queries; private final java.util.Map generators; private final String schemaName; private final String defaultCascade; private static final String[] NO_STRINGS = {}; *************** *** 105,112 **** java.util.Map classes, java.util.Map collections, ! java.util.List tables, ! java.util.List foreignKeys, ! java.util.List primaryKeys, ! java.util.List indexes, java.util.Map generators, java.util.Map queries --- 101,105 ---- java.util.Map classes, java.util.Map collections, ! java.util.Map tables, java.util.Map generators, java.util.Map queries *************** *** 116,122 **** this.collections = collections; this.queries = queries; - this.foreignKeys = foreignKeys; - this.primaryKeys = primaryKeys; - this.indexes = indexes; this.tables = tables; this.generators = generators; --- 109,112 ---- *************** *** 167,191 **** Object old = classes.put( persistentClass.getPersistentClass(), persistentClass ); if ( old!=null ) throw new MappingException( "duplicate class mapping: " + persistentClass.getPersistentClass().getName() ); ! } public void addCollection(Collection collection) throws MappingException { Object old = collections.put( collection.getRole(), collection ); if ( old!=null ) throw new MappingException( "duplicate collection role: " + collection.getRole() ); } ! public void addTable(Table table) { ! tables.add(table); ! } ! public void addPrimaryKey(PrimaryKey pk) { ! primaryKeys.add(pk); ! } ! public void addForeignKey(ForeignKey fk) { ! foreignKeys.add(fk); ! } ! public void addIndex(Index index) { ! indexes.add(index); ! indexLookup.put( index.getName(), index ); ! } ! public Index getIndex(String name) { ! return (Index) indexLookup.get(name); } --- 157,180 ---- Object old = classes.put( persistentClass.getPersistentClass(), persistentClass ); if ( old!=null ) throw new MappingException( "duplicate class mapping: " + persistentClass.getPersistentClass().getName() ); ! } ! public void addCollection(Collection collection) throws MappingException { Object old = collections.put( collection.getRole(), collection ); if ( old!=null ) throw new MappingException( "duplicate collection role: " + collection.getRole() ); } ! public Table addTable(String schema, String name) ! { ! String key = schema != null ? schema + "." + name : name; ! ! Table table = (Table)tables.get(key); ! ! if (table == null) { ! table = new Table(); ! table.setName(name); ! table.setSchema(schema); ! tables.put(key, table); ! } ! return table; } Index: RootClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/RootClass.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** RootClass.java 30 Nov 2002 08:19:00 -0000 1.53 --- RootClass.java 14 Dec 2002 09:27:55 -0000 1.54 *************** *** 96,106 **** tableNameNode.getNodeValue(); - table = new Table(); - table.setName(tableName); Node schemaNode = atts.getNamedItem("schema"); ! table.setSchema( ! (schemaNode==null) ? root.getSchemaName() : schemaNode.getNodeValue() ! ); ! root.addTable(table); addTable(table); --- 96,102 ---- tableNameNode.getNodeValue(); Node schemaNode = atts.getNamedItem("schema"); ! String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! table = root.addTable(schema, tableName); addTable(table); Index: Subclass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Subclass.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Subclass.java 26 Nov 2002 08:37:25 -0000 1.21 --- Subclass.java 14 Dec 2002 09:27:55 -0000 1.22 *************** *** 108,117 **** // joined subclasses String tableName = tableNameNode.getNodeValue(); - this.table = new Table(); - this.table.setName(tableName); Node schemaNode = atts.getNamedItem("schema"); ! this.table.setSchema( ! (schemaNode==null) ? root.getSchemaName() : schemaNode.getNodeValue() ! ); addTable(this.table); --- 108,114 ---- // joined subclasses String tableName = tableNameNode.getNodeValue(); Node schemaNode = atts.getNamedItem("schema"); ! String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! this.table = root.addTable(schema, tableName); addTable(this.table); *************** *** 145,150 **** pk.addColumn(col); } - - root.addTable(this.table); } --- 142,145 ---- Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Table.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Table.java 25 Nov 2002 05:17:59 -0000 1.30 --- Table.java 14 Dec 2002 09:27:55 -0000 1.31 *************** *** 4,7 **** --- 4,8 ---- import java.util.Iterator; import java.util.Map; + import java.util.HashMap; import cirrus.hibernate.engine.Mapping; *************** *** 12,16 **** import cirrus.hibernate.sql.HSQLDialect; import cirrus.hibernate.HibernateException; ! import cirrus.hibernate.tools.JdbcColumnInfo; import org.apache.commons.collections.SequencedHashMap; --- 13,19 ---- import cirrus.hibernate.sql.HSQLDialect; import cirrus.hibernate.HibernateException; ! import cirrus.hibernate.tools.updater.JdbcColumnInfo; ! import cirrus.hibernate.tools.updater.JdbcTableInfo; ! import org.apache.commons.collections.SequencedHashMap; *************** *** 21,25 **** private IdentifierGenerator identifierGenerator = Assigned.INSTANCE; private PrimaryKey primaryKey; ! private int counter=0; private final int uniqueInteger; private static int tableCounter=0; --- 24,29 ---- private IdentifierGenerator identifierGenerator = Assigned.INSTANCE; private PrimaryKey primaryKey; ! private Map indexes = new HashMap(); ! private Map foreignKeys = new HashMap(); private final int uniqueInteger; private static int tableCounter=0; *************** *** 60,65 **** return columns.values().iterator(); } ! public String sqlAlterString(Dialect dialect,Mapping p,java.util.Map columns) throws HibernateException { // String pkname = null; --- 64,75 ---- return columns.values().iterator(); } + public Iterator indexIterator() { + return indexes.values().iterator(); + } + public Iterator foreignKeyIterator() { + return foreignKeys.values().iterator(); + } ! public String sqlAlterString(Dialect dialect,Mapping p,JdbcTableInfo tableInfo) throws HibernateException { // String pkname = null; *************** *** 78,89 **** Column col=(Column) iter.next(); ! String name=col.getName().toLowerCase(); ! JdbcColumnInfo ci=(JdbcColumnInfo) columns.get(name); ! if (ci==null) { // the column doesnt exist at all. if (buf.length()!=0) ! buf.append(','); ! buf.append("add ").append(name).append(' ').append(col.getSqlType(dialect,p)); if (col.isUnique()&&dialect.supportsUnique()) { buf.append(" unique"); --- 88,98 ---- Column col=(Column) iter.next(); ! JdbcColumnInfo columnInfo=tableInfo.getColumnInfo(col.getName()); ! if (columnInfo==null) { // the column doesnt exist at all. if (buf.length()!=0) ! buf.append(", "); ! buf.append(col.getName()).append(' ').append(col.getSqlType(dialect,p)); if (col.isUnique()&&dialect.supportsUnique()) { buf.append(" unique"); *************** *** 96,100 **** return null; ! return new StringBuffer("alter table ").append(getQualifiedName()).append(" ").append(buf).toString(); } --- 105,109 ---- return null; ! return new StringBuffer("alter table ").append(getQualifiedName()).append(" add ").append(buf).toString(); } *************** *** 174,179 **** } ! public int generateConstraintID() { ! return counter++; } --- 183,220 ---- } ! public Index getIndex(String name) ! { ! Index index = (Index)indexes.get(name); ! ! if (index == null) { ! index = new Index(); ! index.setName(name); ! index.setTable(this); ! indexes.put(name, index); ! } ! ! return index; ! } ! ! public ForeignKey getForeignKey(String name) ! { ! ForeignKey fk = (ForeignKey)foreignKeys.get(name); ! ! if (fk == null) { ! fk = new ForeignKey(); ! fk.setName(name); ! fk.setTable(this); ! foreignKeys.put(name, fk); ! } ! ! return fk; ! } ! ! public int generateConstraintID(Iterator iterator) { ! int result = 0; ! ! while (iterator.hasNext()) result += iterator.next().hashCode(); ! ! return result; } Index: Value.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Value.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Value.java 22 Nov 2002 00:27:08 -0000 1.41 --- Value.java 14 Dec 2002 09:27:55 -0000 1.42 *************** *** 23,27 **** public void addColumn(Column column) { ! this.columns.add(column); } public int getColumnSpan() { --- 23,27 ---- public void addColumn(Column column) { ! if (!columns.contains(column)) columns.add(column); } public int getColumnSpan() { *************** *** 87,98 **** if ( indexNode!=null && table!=null ) { //TODO: what do you do about associations?? (second pass compile) String iname = indexNode.getNodeValue(); ! Index index = root.getIndex(iname); ! if ( index==null ) { ! index = new Index(); ! index.setName(iname); ! index.setTable(table); ! root.addIndex(index); ! } ! index.addColumn(col); } } --- 87,91 ---- if ( indexNode!=null && table!=null ) { //TODO: what do you do about associations?? (second pass compile) String iname = indexNode.getNodeValue(); ! table.getIndex(iname).addColumn(col); } } *************** *** 113,125 **** public void createForeignKeyOfClass(Root root, Table table, Class persistentClass) { //foreign key ! ForeignKey fk = new ForeignKey(); Iterator iter = getConstraintColumnIterator(); ! while ( iter.hasNext() ) { ! fk.addColumn( (Column) iter.next() ); ! } ! fk.setTable(table); ! fk.setName( StringHelper.suffix( table.getName(), "FK" + table.generateConstraintID() ) ); fk.setReferencedClass(persistentClass); - root.addForeignKey(fk); } --- 106,115 ---- public void createForeignKeyOfClass(Root root, Table table, Class persistentClass) { //foreign key ! int keyID = table.generateConstraintID(getConstraintColumnIterator()); ! String name = StringHelper.suffix(table.getName(), "FK" + Integer.toHexString(keyID).toUpperCase()); ! ForeignKey fk = table.getForeignKey(name); Iterator iter = getConstraintColumnIterator(); ! while (iter.hasNext()) fk.addColumn((Column)iter.next()); fk.setReferencedClass(persistentClass); } |
From: <one...@us...> - 2002-12-14 09:27:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv888/impl Modified Files: DatastoreImpl.java QueryImpl.java ScrollableResultsImpl.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: DatastoreImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/DatastoreImpl.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** DatastoreImpl.java 24 Nov 2002 11:48:11 -0000 1.22 --- DatastoreImpl.java 14 Dec 2002 09:27:55 -0000 1.23 *************** *** 25,28 **** --- 25,30 ---- import cirrus.hibernate.Datastore; import cirrus.hibernate.MappingException; + import cirrus.hibernate.tools.updater.JdbcDatabaseInfo; + import cirrus.hibernate.tools.updater.JdbcTableInfo; import cirrus.hibernate.id.PersistentIdentifierGenerator; import cirrus.hibernate.sql.Dialect; *************** *** 35,42 **** private HashMap classes = new HashMap(); private HashMap collections = new HashMap(); ! private ArrayList tables = new ArrayList(); ! private ArrayList primaryKeys = new ArrayList(); ! private ArrayList foreignKeys = new ArrayList(); ! private ArrayList indexes = new ArrayList(); private HashMap generators = new HashMap(); private HashMap namedQueries = new HashMap(); --- 37,41 ---- private HashMap classes = new HashMap(); private HashMap collections = new HashMap(); ! private HashMap tables = new HashMap(); private HashMap generators = new HashMap(); private HashMap namedQueries = new HashMap(); *************** *** 59,62 **** --- 58,65 ---- } + public Iterator getTableMaps() { + return tables.values().iterator(); + } + public PersistentClass getPersistentClass(Class persistentClass) { return (PersistentClass) classes.get(persistentClass); *************** *** 101,105 **** private void store(Document doc) throws Exception { try { ! new Root(doc, classes, collections, tables, foreignKeys, primaryKeys, indexes, generators, namedQueries); } catch (MappingException me) { --- 104,108 ---- private void store(Document doc) throws Exception { try { ! new Root(doc, classes, collections, tables, generators, namedQueries); } catch (MappingException me) { *************** *** 186,194 **** if ( dialect.dropConstraints() ) { ! Iterator iter = foreignKeys.iterator(); ! while ( iter.hasNext() ) script.add( ( (Constraint) iter.next() ).sqlDropString(dialect) ); } ! Iterator iter = tables.iterator(); while ( iter.hasNext() ) script.add( ( (Table) iter.next() ).sqlDropString(dialect) ); --- 189,204 ---- if ( dialect.dropConstraints() ) { ! Iterator iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while ( subIter.hasNext() ) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! script.add(fk.sqlDropString(dialect)); ! } ! } } ! Iterator iter = getTableMaps(); while ( iter.hasNext() ) script.add( ( (Table) iter.next() ).sqlDropString(dialect) ); *************** *** 207,211 **** ArrayList script = new ArrayList(50); ! Iterator iter = tables.iterator(); while ( iter.hasNext() ) { Table table = (Table) iter.next(); --- 217,221 ---- ArrayList script = new ArrayList(50); ! Iterator iter = getTableMaps(); while ( iter.hasNext() ) { Table table = (Table) iter.next(); *************** *** 213,226 **** } ! iter = primaryKeys.iterator(); ! while ( iter.hasNext() ) script.add( ( (Constraint) iter.next() ).sqlCreateString(dialect, this) ); ! if( dialect.hasAlterTable() ) { ! iter = foreignKeys.iterator(); ! while ( iter.hasNext() ) script.add( ( (Constraint) iter.next() ).sqlCreateString(dialect, this) ); ! } ! iter = indexes.iterator(); ! while ( iter.hasNext() ) script.add( ( (Index) iter.next() ).sqlCreateString(dialect, this) ); iter = generators.values().iterator(); --- 223,245 ---- } ! iter = getTableMaps(); ! while (iter.hasNext()) { ! Table table = (Table)iter.next(); ! Iterator subIter; ! if (dialect.hasAlterTable()) { ! subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! script.add(fk.sqlCreateString(dialect, this)); ! } ! } ! subIter = table.indexIterator(); ! while (subIter.hasNext()) { ! Index index = (Index)subIter.next(); ! script.add(index.sqlCreateString(dialect, this)); ! } ! } iter = generators.values().iterator(); *************** *** 234,285 **** } ! public String[] generateSchemaUpdateScript(Dialect dialect, java.util.Map tableColumnInfo) throws HibernateException { secondPassCompile(); ArrayList script = new ArrayList(50); ! Iterator iter = tables.iterator(); while ( iter.hasNext() ) { Table table = (Table) iter.next(); ! java.util.Map ci = (java.util.Map) tableColumnInfo.get( table.getName().toLowerCase() ); ! if (ci == null) { script.add( table.sqlCreateString(dialect, this) ); } else { ! final String sql = table.sqlAlterString(dialect, this, ci); if (sql != null) script.add(sql); } } ! iter = primaryKeys.iterator(); ! while ( iter.hasNext() ) { ! Constraint constraint = (Constraint) iter.next(); ! if ( !tableColumnInfo.containsKey( constraint.getName() ) ) ! script.add( constraint.sqlCreateString(dialect, this) ); ! } ! if( dialect.hasAlterTable() ) { ! iter = foreignKeys.iterator(); ! while ( iter.hasNext() ) { ! Constraint constraint = (Constraint) iter.next(); ! if ( !tableColumnInfo.containsKey( constraint.getName() ) ) ! script.add( constraint.sqlCreateString(dialect, this) ); } - } ! iter = indexes.iterator(); ! while ( iter.hasNext() ) { ! Index constraint = (Index) iter.next(); ! if (!tableColumnInfo.containsKey(constraint.getName())) ! script.add( constraint.sqlCreateString(dialect, this) ); } - /* iter = generators.values().iterator(); ! while ( iter.hasNext() ) ! { ! String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlCreateStrings(dialect); ! for ( int i=0; i<lines.length; i++ ) script.add( lines[i] ); } - */ return ArrayHelper.toStringArray(script); --- 253,305 ---- } ! public String[] generateSchemaUpdateScript(Dialect dialect, JdbcDatabaseInfo databaseInfo) throws HibernateException { secondPassCompile(); ArrayList script = new ArrayList(50); ! Iterator iter = getTableMaps(); while ( iter.hasNext() ) { Table table = (Table) iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! if (tableInfo == null) { script.add( table.sqlCreateString(dialect, this) ); } else { ! final String sql = table.sqlAlterString(dialect, this, tableInfo); if (sql != null) script.add(sql); } } ! iter = getTableMaps(); ! while (iter.hasNext()) { ! Table table = (Table)iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! Iterator subIter; ! ! if (dialect.hasAlterTable()) { ! subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (tableInfo == null || tableInfo.getForeignKeyInfo(fk.getName())==null) ! script.add(fk.sqlCreateString(dialect, this)); ! } } ! subIter = table.indexIterator(); ! while (subIter.hasNext()) { ! Index index = (Index)subIter.next(); ! if (tableInfo == null || tableInfo.getIndexInfo(index.getName())==null) ! script.add(index.sqlCreateString(dialect, this)); ! } } iter = generators.values().iterator(); ! while (iter.hasNext()) { ! PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator)iter.next(); ! if (!databaseInfo.isSequence(generator.generatorKey())) { ! String[] lines = generator.sqlCreateStrings(dialect); ! for (int i = 0; i < lines.length; i++) script.add(lines[i]); ! } } return ArrayHelper.toStringArray(script); *************** *** 295,307 **** //TODO: Somehow add the newly created foreign keys to the internal collection ! iter = foreignKeys.iterator(); while ( iter.hasNext() ) { ! ForeignKey fk = (ForeignKey) iter.next(); ! if ( fk.getReferencedTable()==null ) { ! PersistentClass referencedClass = (PersistentClass) classes.get( fk.getReferencedClass() ); ! if ( referencedClass==null ) throw new MappingException( ! "An association refers to an unmapped class: " + fk.getReferencedClass().getName() ! ); ! fk.setReferencedTable( referencedClass.getTable() ); } } --- 315,330 ---- //TODO: Somehow add the newly created foreign keys to the internal collection ! iter = getTableMaps(); while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (fk.getReferencedTable() == null) { ! PersistentClass referencedClass = (PersistentClass)classes.get(fk.getReferencedClass()); ! if (referencedClass == null) ! throw new MappingException("An association refers to an unmapped class: " + fk.getReferencedClass().getName()); ! fk.setReferencedTable(referencedClass.getTable()); ! } } } Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/QueryImpl.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** QueryImpl.java 21 Nov 2002 09:03:11 -0000 1.19 --- QueryImpl.java 14 Dec 2002 09:27:55 -0000 1.20 *************** *** 242,246 **** setParameter(name, val, Hibernate.BINARY); } ! /* * @see Query#setBoolean(String, boolean) --- 242,246 ---- setParameter(name, val, Hibernate.BINARY); } ! /* * @see Query#setBoolean(String, boolean) Index: ScrollableResultsImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/ScrollableResultsImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ScrollableResultsImpl.java 26 Nov 2002 03:35:42 -0000 1.7 --- ScrollableResultsImpl.java 14 Dec 2002 09:27:55 -0000 1.8 *************** *** 112,115 **** --- 112,122 ---- } + /** + * @see cirrus.hibernate.ScrollableResults#getBlob(int) + */ + public java.sql.Blob getBlob(int col) throws SQLException, HibernateException { + return (java.sql.Blob) get(col); + } + /** * @see cirrus.hibernate.ScrollableResults#getBoolean(int) |
From: <one...@us...> - 2002-12-14 09:27:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv888 Modified Files: Datastore.java Hibernate.java ScrollableResults.java Log Message: Benoit Menendez patches to SchemaUpdater and blob support Index: Datastore.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Datastore.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Datastore.java 4 Nov 2002 00:55:30 -0000 1.31 --- Datastore.java 14 Dec 2002 09:27:55 -0000 1.32 *************** *** 7,10 **** --- 7,11 ---- import org.w3c.dom.Document; import cirrus.hibernate.sql.Dialect; + import cirrus.hibernate.tools.updater.JdbcDatabaseInfo; /** *************** *** 153,157 **** public String[] generateDropSchemaScript(Dialect dialect) throws HibernateException; - String[] generateSchemaUpdateScript(Dialect dialect, java.util.Map tableColumnInfo) throws HibernateException; } --- 154,158 ---- public String[] generateDropSchemaScript(Dialect dialect) throws HibernateException; + public String[] generateSchemaUpdateScript(Dialect dialect, JdbcDatabaseInfo info) throws HibernateException; } Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Hibernate.java 27 Nov 2002 22:38:02 -0000 1.63 --- Hibernate.java 14 Dec 2002 09:27:55 -0000 1.64 *************** *** 87,90 **** --- 87,98 ---- */ public static final NullableType BINARY = new BinaryType(); + /** + * Hibernate <tt>blob</tt> type + */ + public static final NullableType BLOB = new BlobType(); + /** + * Hibernate <tt>clob</tt> type + */ + public static final NullableType CLOB = new ClobType(); /** * Hibernate <tt>calendar</tt> type Index: ScrollableResults.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/ScrollableResults.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScrollableResults.java 26 Nov 2002 03:35:40 -0000 1.6 --- ScrollableResults.java 14 Dec 2002 09:27:55 -0000 1.7 *************** *** 123,126 **** --- 123,130 ---- */ public byte[] getBinary(int col) throws SQLException, HibernateException; + /** + * Convenience method to read a blob + */ + public java.sql.Blob getBlob(int col) throws SQLException, HibernateException; /** * Convenience method to read a string |
From: <one...@us...> - 2002-12-14 09:20:19
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv31923/transaction Modified Files: WebSphereTransactionManagerLookup.java Log Message: fixed compile probs Index: WebSphereTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction/WebSphereTransactionManagerLookup.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WebSphereTransactionManagerLookup.java 12 Dec 2002 11:14:10 -0000 1.5 --- WebSphereTransactionManagerLookup.java 14 Dec 2002 09:20:16 -0000 1.6 *************** *** 6,12 **** --- 6,17 ---- import javax.transaction.TransactionManager; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + import cirrus.hibernate.HibernateException; public class WebSphereTransactionManagerLookup implements TransactionManagerLookup { + + private static final Log log = LogFactory.getLog(WebSphereTransactionManagerLookup.class); /** *************** *** 22,26 **** catch (Exception e) { clazz = Class.forName("com.ibm.ejcs.jts.jta.JTSXA"); ! log.info(WebSphere 5"); } return (TransactionManager) clazz --- 27,31 ---- catch (Exception e) { clazz = Class.forName("com.ibm.ejcs.jts.jta.JTSXA"); ! log.info("WebSphere 5"); } return (TransactionManager) clazz |
From: <one...@us...> - 2002-12-14 09:08:27
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/updater In directory sc8-pr-cvs1:/tmp/cvs-serv29708/tools/updater Log Message: Directory /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/updater added to the repository |
From: <one...@us...> - 2002-12-14 08:54:45
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv26361/test Modified Files: ParentChildTest.java Log Message: fixed the test Index: ParentChildTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/ParentChildTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ParentChildTest.java 7 Dec 2002 09:41:22 -0000 1.32 --- ParentChildTest.java 14 Dec 2002 08:54:42 -0000 1.33 *************** *** 366,369 **** --- 366,370 ---- c4.getLazyBag().add(c); assertTrue( c.getLazyBag().size()==3 ); + s.save(c4); t.commit(); s.close(); *************** *** 379,382 **** --- 380,384 ---- } assertTrue(j==4); + assertTrue( c.getLazyBag().size()==3 ); s.delete(c); c.getBag().remove(c2); |
From: <one...@us...> - 2002-12-14 07:21:50
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv10379/cirrus/hibernate/sql Modified Files: MySQLDialect.java Log Message: Changed timestamp mapping for MySQL to DATETIME Index: MySQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/MySQLDialect.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MySQLDialect.java 25 Oct 2002 14:37:58 -0000 1.20 --- MySQLDialect.java 14 Dec 2002 07:21:47 -0000 1.21 *************** *** 27,31 **** register( Types.DATE, "DATE" ); register( Types.TIME, "TIME" ); ! register( Types.TIMESTAMP, "TIMESTAMP" ); register( Types.VARBINARY, "LONGBLOB" ); register( Types.VARBINARY, 16777215, "MEDIUMBLOB" ); --- 27,31 ---- register( Types.DATE, "DATE" ); register( Types.TIME, "TIME" ); ! register( Types.TIMESTAMP, "DATETIME" ); register( Types.VARBINARY, "LONGBLOB" ); register( Types.VARBINARY, 16777215, "MEDIUMBLOB" ); |
From: <one...@us...> - 2002-12-12 11:33:39
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv24359 Added Files: BlobType.java ClobType.java Log Message: BlobType, ClobType (by Benoit Menendez) --- NEW FILE: BlobType.java --- //$Id: BlobType.java,v 1.1 2002/12/12 11:33:36 oneovthafew Exp $ package cirrus.hibernate.type; import java.sql.*; import cirrus.hibernate.HibernateException; public class BlobType extends ImmutableType { public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { st.setBlob(index, (Blob) value); } public Object get(ResultSet rs, String name) throws HibernateException, SQLException { return rs.getBlob(name); } public int sqlType() { return Types.VARBINARY; //TODO: Types.BLOB } public Class returnedClass() { return Blob.class; } public boolean hasNiceEquals() { return false; } public boolean equals(Object x, Object y) throws HibernateException { return x == y; } public String getName() { return "blob"; } public String toXML(Object val) throws HibernateException { return val.toString(); } } --- NEW FILE: ClobType.java --- //$Id: ClobType.java,v 1.1 2002/12/12 11:33:36 oneovthafew Exp $ package cirrus.hibernate.type; import java.sql.*; import cirrus.hibernate.HibernateException; public class ClobType extends ImmutableType { public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { st.setClob(index, (Clob) value); } public Object get(ResultSet rs, String name) throws HibernateException, SQLException { return rs.getClob(name); } public int sqlType() { return Types.VARCHAR; //TODO: Types.CLOB } public Class returnedClass() { return Clob.class; } public boolean hasNiceEquals() { return false; } public boolean equals(Object x, Object y) throws HibernateException { return x == y; } public String getName() { return "clob"; } public String toXML(Object val) throws HibernateException { return val.toString(); } } |
From: <one...@us...> - 2002-12-12 11:14:13
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv15678 Modified Files: WebSphereTransactionManagerLookup.java Log Message: support websphere 5 (Venkat Srinivasan) Index: WebSphereTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction/WebSphereTransactionManagerLookup.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebSphereTransactionManagerLookup.java 8 Dec 2002 05:58:58 -0000 1.4 --- WebSphereTransactionManagerLookup.java 12 Dec 2002 11:14:10 -0000 1.5 *************** *** 15,19 **** public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { ! return (TransactionManager) Class.forName("com.ibm.ejcs.jts.jta.JTSXA") .getMethod("getTransactionManager", null) .invoke(null, null); --- 15,28 ---- public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { ! Class clazz=null; ! try { ! clazz = Class.forName("com.ibm.ejs.jts.jta.JTSXA"); ! log.info("WebSphere 4"); ! } ! catch (Exception e) { ! clazz = Class.forName("com.ibm.ejcs.jts.jta.JTSXA"); ! log.info(WebSphere 5"); ! } ! return (TransactionManager) clazz .getMethod("getTransactionManager", null) .invoke(null, null); |
From: <one...@us...> - 2002-12-12 10:49:39
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv2271 Modified Files: JTATransactionFactory.java TransactionManagerLookup.java Log Message: fixed compile problems Index: JTATransactionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction/JTATransactionFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JTATransactionFactory.java 10 Dec 2002 13:13:28 -0000 1.10 --- JTATransactionFactory.java 12 Dec 2002 10:49:36 -0000 1.11 *************** *** 59,63 **** TransactionManagerLookup tmlookup = (TransactionManagerLookup) ReflectHelper.classForName(tmLookupClass).newInstance(); transactionManager = tmlookup.getTransactionManager(props); ! if (utname==null) utname = tmlookup.getUserTransactionName(); log.info("TransactionManager lookup successful"); } --- 59,63 ---- TransactionManagerLookup tmlookup = (TransactionManagerLookup) ReflectHelper.classForName(tmLookupClass).newInstance(); transactionManager = tmlookup.getTransactionManager(props); ! if (utName==null) utName = tmlookup.getUserTransactionName(); log.info("TransactionManager lookup successful"); } Index: TransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction/TransactionManagerLookup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TransactionManagerLookup.java 8 Dec 2002 05:58:58 -0000 1.3 --- TransactionManagerLookup.java 12 Dec 2002 10:49:36 -0000 1.4 *************** *** 22,28 **** * or <tt>null</tt> (optional operation). */ ! public String getUserTransactionName() { ! return null; ! } } --- 22,26 ---- * or <tt>null</tt> (optional operation). */ ! public String getUserTransactionName(); } |
From: <one...@us...> - 2002-12-10 13:13:31
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv6002/cirrus/hibernate/transaction Modified Files: JTATransactionFactory.java Log Message: use the default UserTransactionName defined on the TransactionManagerLookup Index: JTATransactionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction/JTATransactionFactory.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JTATransactionFactory.java 27 Oct 2002 03:11:33 -0000 1.9 --- JTATransactionFactory.java 10 Dec 2002 13:13:28 -0000 1.10 *************** *** 36,41 **** public void configure(Properties props) throws HibernateException { - utName = props.getProperty(Environment.USER_TRANSACTION); - if (utName==null) utName = DEFAULT_USER_TRANSACTION_NAME; try { --- 36,39 ---- *************** *** 47,62 **** } ! String tmLookup = props.getProperty(Environment.TRANSACTION_MANAGER_STRATEGY); ! if (tmLookup==null) { ! log.warn("No TransactionManagerLookup configured (use of JCS read-write cache is not recommended)"); transactionManager=null; } else { ! log.info("Locating TransactionManager using: " + tmLookup); try { ! transactionManager = ( (TransactionManagerLookup) ReflectHelper.classForName(tmLookup).newInstance() ) ! .getTransactionManager(props); log.info("TransactionManager lookup successful"); } --- 45,63 ---- } ! utName = props.getProperty(Environment.USER_TRANSACTION); ! ! String tmLookupClass = props.getProperty(Environment.TRANSACTION_MANAGER_STRATEGY); ! if (tmLookupClass==null) { ! log.info("No TransactionManagerLookup configured (use of JCS read-write cache is not recommended)"); transactionManager=null; } else { ! log.info("Locating TransactionManager using: " + tmLookupClass); try { ! TransactionManagerLookup tmlookup = (TransactionManagerLookup) ReflectHelper.classForName(tmLookupClass).newInstance(); ! transactionManager = tmlookup.getTransactionManager(props); ! if (utname==null) utname = tmlookup.getUserTransactionName(); log.info("TransactionManager lookup successful"); } *************** *** 70,73 **** --- 71,76 ---- } + if (utName==null) utName = DEFAULT_USER_TRANSACTION_NAME; + } |
From: <one...@us...> - 2002-12-10 12:48:09
|
Update of /cvsroot/hibernate/Tools/src/cirrus/hibernate/tools/xdoclet/resources In directory sc8-pr-cvs1:/tmp/cvs-serv29905/src/cirrus/hibernate/tools/xdoclet/resources Modified Files: hibernate.xdt Log Message: fixed a missing quote Index: hibernate.xdt =================================================================== RCS file: /cvsroot/hibernate/Tools/src/cirrus/hibernate/tools/xdoclet/resources/hibernate.xdt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hibernate.xdt 7 Dec 2002 15:16:14 -0000 1.8 --- hibernate.xdt 10 Dec 2002 12:48:05 -0000 1.9 *************** *** 21,25 **** </XDtClass:ifHasClassTag> <XDtClass:ifHasClassTag tagName="hibernate.class" paramName="mutable" superclasses="false"> ! mutable="<XDtClass:classTagValue tagName="hibernate.class" paramName="mutable />" </XDtClass:ifHasClassTag> <XDtClass:ifHasClassTag tagName="hibernate.class" paramName="discriminator-value" superclasses="false"> --- 21,25 ---- </XDtClass:ifHasClassTag> <XDtClass:ifHasClassTag tagName="hibernate.class" paramName="mutable" superclasses="false"> ! mutable="<XDtClass:classTagValue tagName="hibernate.class" paramName="mutable" />" </XDtClass:ifHasClassTag> <XDtClass:ifHasClassTag tagName="hibernate.class" paramName="discriminator-value" superclasses="false"> |