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...> - 2003-04-08 14:26:46
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv31984/dialect Modified Files: DB2Dialect.java HSQLDialect.java InterbaseDialect.java MckoiDialect.java MySQLDialect.java Oracle9Dialect.java PointbaseDialect.java PostgreSQLDialect.java SAPDBDialect.java SybaseDialect.java Log Message: added option to disable reflection optimizer Index: DB2Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/DB2Dialect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DB2Dialect.java 26 Jan 2003 01:33:35 -0000 1.5 --- DB2Dialect.java 8 Apr 2003 14:26:38 -0000 1.6 *************** *** 30,34 **** register( Types.CLOB, "CLOB($l)" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } --- 30,34 ---- register( Types.CLOB, "CLOB($l)" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } Index: HSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/HSQLDialect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HSQLDialect.java 26 Jan 2003 01:33:35 -0000 1.5 --- HSQLDialect.java 8 Apr 2003 14:26:38 -0000 1.6 *************** *** 34,38 **** register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "false"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } --- 34,38 ---- register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "false"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } Index: InterbaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/InterbaseDialect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InterbaseDialect.java 26 Jan 2003 01:33:35 -0000 1.5 --- InterbaseDialect.java 8 Apr 2003 14:26:38 -0000 1.6 *************** *** 30,34 **** register( Types.CLOB, "BLOB SUB_TYPE 1" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); getDefaultProperties().setProperty(Environment.STATEMENT_CACHE_SIZE, "0"); --- 30,34 ---- register( Types.CLOB, "BLOB SUB_TYPE 1" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); getDefaultProperties().setProperty(Environment.STATEMENT_CACHE_SIZE, "0"); Index: MckoiDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/MckoiDialect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MckoiDialect.java 26 Jan 2003 01:33:35 -0000 1.5 --- MckoiDialect.java 8 Apr 2003 14:26:38 -0000 1.6 *************** *** 28,32 **** register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "false"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } --- 28,32 ---- register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "false"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } Index: MySQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/MySQLDialect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MySQLDialect.java 26 Jan 2003 01:33:35 -0000 1.5 --- MySQLDialect.java 8 Apr 2003 14:26:39 -0000 1.6 *************** *** 40,44 **** register( Types.CLOB, 65535, "TEXT" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); } --- 40,44 ---- register( Types.CLOB, 65535, "TEXT" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); } Index: Oracle9Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Oracle9Dialect.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Oracle9Dialect.java 1 Feb 2003 12:24:06 -0000 1.1 --- Oracle9Dialect.java 8 Apr 2003 14:26:39 -0000 1.2 *************** *** 32,36 **** getDefaultProperties().setProperty(Environment.USE_STREAMS_FOR_BINARY, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); } --- 32,36 ---- getDefaultProperties().setProperty(Environment.USE_STREAMS_FOR_BINARY, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); } Index: PointbaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PointbaseDialect.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PointbaseDialect.java 26 Jan 2003 01:33:35 -0000 1.4 --- PointbaseDialect.java 8 Apr 2003 14:26:39 -0000 1.5 *************** *** 35,39 **** register( Types.NUMERIC, "NUMERIC(19, $l)" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); } --- 35,39 ---- register( Types.NUMERIC, "NUMERIC(19, $l)" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); } Index: PostgreSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PostgreSQLDialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PostgreSQLDialect.java 12 Mar 2003 12:28:58 -0000 1.7 --- PostgreSQLDialect.java 8 Apr 2003 14:26:39 -0000 1.8 *************** *** 30,34 **** register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); } --- 30,34 ---- register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); } Index: SAPDBDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SAPDBDialect.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SAPDBDialect.java 23 Feb 2003 07:22:11 -0000 1.8 --- SAPDBDialect.java 8 Apr 2003 14:26:39 -0000 1.9 *************** *** 36,40 **** register( Types.BLOB, "LONG BYTE" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); --- 36,40 ---- register( Types.BLOB, "LONG BYTE" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE); Index: SybaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SybaseDialect.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SybaseDialect.java 26 Jan 2003 01:33:35 -0000 1.4 --- SybaseDialect.java 8 Apr 2003 14:26:39 -0000 1.5 *************** *** 30,34 **** register( Types.CLOB, "TEXT" ); ! getDefaultProperties().setProperty(Environment.OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } --- 30,34 ---- register( Types.CLOB, "TEXT" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } |
From: <one...@us...> - 2003-04-08 14:26:45
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv31984/jmx Modified Files: HibernateService.java Log Message: added option to disable reflection optimizer Index: HibernateService.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx/HibernateService.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HibernateService.java 22 Feb 2003 06:42:08 -0000 1.6 --- HibernateService.java 8 Apr 2003 14:26:41 -0000 1.7 *************** *** 88,97 **** public boolean getUseOuterJoin() { ! String prop = getProperty(Environment.OUTER_JOIN); return Boolean.valueOf(prop).booleanValue(); } public void setUseOuterJoin(boolean uoj) { ! setProperty( Environment.OUTER_JOIN, uoj ? "true" : "false" ); //Boolean.toString() only in JDK1.4 } --- 88,97 ---- public boolean getUseOuterJoin() { ! String prop = getProperty(Environment.USE_OUTER_JOIN); return Boolean.valueOf(prop).booleanValue(); } public void setUseOuterJoin(boolean uoj) { ! setProperty( Environment.USE_OUTER_JOIN, uoj ? "true" : "false" ); //Boolean.toString() only in JDK1.4 } |
From: <one...@us...> - 2003-04-08 14:26:44
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv31984/impl Modified Files: SessionFactoryImpl.java Log Message: added option to disable reflection optimizer Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SessionFactoryImpl.java 2 Apr 2003 01:06:52 -0000 1.16 --- SessionFactoryImpl.java 8 Apr 2003 14:26:40 -0000 1.17 *************** *** 97,100 **** --- 97,101 ---- private transient final boolean showSql; private transient final boolean useOuterJoin; + private transient final boolean useReflectionOptimizer; private transient final boolean supportsLocking; private transient final Templates templates; *************** *** 132,135 **** --- 133,137 ---- //temp.putAll( Environment.getProperties() ); temp.putAll( dl.getDefaultProperties() ); + temp.put(Environment.USE_REFLECTION_OPTIMIZER, Boolean.TRUE); temp.putAll(properties); properties = temp; // add the dialects default properties *************** *** 150,156 **** if (statementFetchSize!=null) log.info("JDBC result set fetch size: " + statementFetchSize); ! useOuterJoin = PropertiesHelper.getBoolean(Environment.OUTER_JOIN, properties); log.info("Use outer join fetching: " + useOuterJoin); boolean usrs = PropertiesHelper.getBoolean(Environment.USE_SCROLLABLE_RESULTSET, properties); int batchSize = PropertiesHelper.getInt(Environment.STATEMENT_BATCH_SIZE, properties, 0); --- 152,160 ---- if (statementFetchSize!=null) log.info("JDBC result set fetch size: " + statementFetchSize); ! useOuterJoin = PropertiesHelper.getBoolean(Environment.USE_OUTER_JOIN, properties); log.info("Use outer join fetching: " + useOuterJoin); + useReflectionOptimizer = PropertiesHelper.getBoolean(Environment.USE_REFLECTION_OPTIMIZER, properties); + boolean usrs = PropertiesHelper.getBoolean(Environment.USE_SCROLLABLE_RESULTSET, properties); int batchSize = PropertiesHelper.getInt(Environment.STATEMENT_BATCH_SIZE, properties, 0); *************** *** 693,696 **** --- 697,704 ---- if (statementCache!=null) statementCache.close(); connections.close(); + } + + public boolean useReflectionOptimizer() { + return useReflectionOptimizer; } |
From: <one...@us...> - 2003-04-08 14:26:43
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv31984/engine Modified Files: SessionFactoryImplementor.java Log Message: added option to disable reflection optimizer Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SessionFactoryImplementor.java 29 Mar 2003 04:08:46 -0000 1.6 --- SessionFactoryImplementor.java 8 Apr 2003 14:26:40 -0000 1.7 *************** *** 37,40 **** --- 37,44 ---- /** + * Is the reflection optimizer enabled? + */ + public boolean useReflectionOptimizer(); + /** * Is outerjoin fetching enabled? */ |
From: <one...@us...> - 2003-04-08 14:08:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv23476/test Modified Files: DoubleStringType.java FooBarTest.java Log Message: fixed an order by clause bug in new Criteria stuff Index: DoubleStringType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/DoubleStringType.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DoubleStringType.java 6 Apr 2003 10:11:11 -0000 1.5 --- DoubleStringType.java 8 Apr 2003 14:07:08 -0000 1.6 *************** *** 62,66 **** public String[] getPropertyNames() { ! return new String[] { "1", "2" }; } --- 62,66 ---- public String[] getPropertyNames() { ! return new String[] { "s1", "s2" }; } Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** FooBarTest.java 8 Apr 2003 09:49:33 -0000 1.51 --- FooBarTest.java 8 Apr 2003 14:07:09 -0000 1.52 *************** *** 2195,2199 **** s.save(foo); foo.setCustom( new String[] { "one", "two" } ); ! assertTrue( s.find("from Foo foo where foo.custom.1 = 'one'").get(0)==foo ); s.delete(foo); s.flush(); --- 2195,2199 ---- s.save(foo); foo.setCustom( new String[] { "one", "two" } ); ! assertTrue( s.find("from Foo foo where foo.custom.s1 = 'one'").get(0)==foo ); s.delete(foo); s.flush(); |
From: <one...@us...> - 2003-04-08 14:08:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv23476/loader Modified Files: AbstractEntityLoader.java CriteriaLoader.java Log Message: fixed an order by clause bug in new Criteria stuff Index: AbstractEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/AbstractEntityLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractEntityLoader.java 8 Mar 2003 06:31:23 -0000 1.2 --- AbstractEntityLoader.java 8 Apr 2003 14:07:12 -0000 1.3 *************** *** 22,27 **** alias = alias( persister.getClassName(), 0 ); } ! protected void renderStatement(String condition, SessionFactoryImplementor factory) throws MappingException { List associations = walkTree(persister, alias, factory); --- 22,31 ---- alias = alias( persister.getClassName(), 0 ); } ! protected void renderStatement(String condition, SessionFactoryImplementor factory) throws MappingException { + renderStatement(condition, StringHelper.EMPTY_STRING, factory); + } + + protected void renderStatement(String condition, String orderBy, SessionFactoryImplementor factory) throws MappingException { List associations = walkTree(persister, alias, factory); *************** *** 47,50 **** --- 51,55 ---- persister.whereJoinFragment(alias, true, true) ) + .setOrderByClause(orderBy) .toStatementString(); Index: CriteriaLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CriteriaLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CriteriaLoader.java 9 Mar 2003 04:04:08 -0000 1.2 --- CriteriaLoader.java 8 Apr 2003 14:07:12 -0000 1.3 *************** *** 39,51 **** } iter = criteria.iterateOrderings(); - if ( iter.hasNext() ) condition.append(" order by "); while ( iter.hasNext() ) { Order ord = (Order) iter.next(); ! condition.append( ord.toSqlString(factory, criteria.getPersistentClass(), alias) ); ! if ( iter.hasNext() ) condition.append(", "); } ! renderStatement( condition.toString(), factory ); } --- 39,51 ---- } + StringBuffer orderBy = new StringBuffer(30); iter = criteria.iterateOrderings(); while ( iter.hasNext() ) { Order ord = (Order) iter.next(); ! orderBy.append( ord.toSqlString(factory, criteria.getPersistentClass(), alias) ); ! if ( iter.hasNext() ) orderBy.append(", "); } ! renderStatement( condition.toString(), orderBy.toString(), factory ); } |
From: <one...@us...> - 2003-04-08 14:08:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv23476/sql Modified Files: Select.java Log Message: fixed an order by clause bug in new Criteria stuff Index: Select.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/Select.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Select.java 15 Mar 2003 04:38:17 -0000 1.2 --- Select.java 8 Apr 2003 14:07:11 -0000 1.3 *************** *** 30,34 **** .append(" WHERE ").append(whereClause) .append(outerJoinsAfterWhere); ! if (orderByClause!=null) buf.append(" ORDER BY ").append(orderByClause); return buf.toString(); } --- 30,37 ---- .append(" WHERE ").append(whereClause) .append(outerJoinsAfterWhere); ! if (orderByClause!=null && orderByClause.trim().length() > 0 ) { ! buf.append(" ORDER BY ") ! .append(orderByClause); ! } return buf.toString(); } |
From: <one...@us...> - 2003-04-08 09:50:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/test Modified Files: FooBar.hbm.xml FooBarTest.java MasterDetailTest.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FooBar.hbm.xml 2 Apr 2003 13:10:38 -0000 1.12 --- FooBar.hbm.xml 8 Apr 2003 09:49:32 -0000 1.13 *************** *** 126,130 **** </array> </component> ! <any name="object" id-type="long"> <column name="clazz" length="100"/> <column name="gen_id"/> --- 126,130 ---- </array> </component> ! <any name="object" id-type="long" cascade="all"> <column name="clazz" length="100"/> <column name="gen_id"/> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** FooBarTest.java 6 Apr 2003 10:11:11 -0000 1.50 --- FooBarTest.java 8 Apr 2003 09:49:33 -0000 1.51 *************** *** 2902,2907 **** BarProxy foo = new Bar(); foo.setObject(one); ! Serializable oid = s.save(one); Serializable fid = s.save(foo); s.flush(); s.connection().commit(); --- 2902,2908 ---- BarProxy foo = new Bar(); foo.setObject(one); ! //Serializable oid = s.save(one); Serializable fid = s.save(foo); + Serializable oid = new Long( one.getKey() ); s.flush(); s.connection().commit(); *************** *** 2922,2926 **** foo = (BarProxy) s.load(Foo.class, fid); assertTrue( foo.getObject()!=null && foo.getObject() instanceof One && s.getIdentifier( foo.getObject() ).equals(oid) ); ! s.delete( foo.getObject() ); s.delete(foo); s.flush(); --- 2923,2927 ---- foo = (BarProxy) s.load(Foo.class, fid); assertTrue( foo.getObject()!=null && foo.getObject() instanceof One && s.getIdentifier( foo.getObject() ).equals(oid) ); ! //s.delete( foo.getObject() ); s.delete(foo); s.flush(); Index: MasterDetailTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MasterDetailTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MasterDetailTest.java 2 Apr 2003 13:10:39 -0000 1.6 --- MasterDetailTest.java 8 Apr 2003 09:49:34 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- import java.io.ObjectOutputStream; import java.io.Serializable; + import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; *************** *** 122,125 **** --- 123,142 ---- assertTrue( s.filter( master.getDetails(), "order by this.i desc").size()==2 ); assertTrue( s.filter( master.getDetails(), "select this where this.id > 0").size()==2 ); + Query q = s.createFilter( master.getDetails(), "where this.id > :id" ); + q.setInteger("id", 0); + assertTrue( q.list().size()==2 ); + q = s.createFilter( master.getDetails(), "where this.id > :id1 and this.id < :id2" ); + q.setInteger("id1", 0); + q.setInteger("id2", 99999999); + assertTrue( q.list().size()==2 ); + q.setInteger("id2", -1); + assertTrue( q.list().size()==0 ); + q = s.createFilter( master.getDetails(), "where this.id in (:ids)" ); + List list = new ArrayList(); + list.add(did); + list.add(new Long(-1)); + q.setParameterList("ids", list); + assertTrue( q.list().size()==1 ); + assertTrue( q.iterate().hasNext() ); assertTrue( s.filter( master.getDetails(), "where this.id > 0").size()==2 ); assertTrue( s.filter( master.getDetails(), "select this.master where this.id > 0").size()==2 ); |
From: <one...@us...> - 2003-04-08 09:50:05
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/mapping Modified Files: Any.java Property.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: Any.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Any.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Any.java 29 Mar 2003 04:15:10 -0000 1.1 --- Any.java 8 Apr 2003 09:49:30 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.mapping; *************** *** 12,18 **** } - /** - * Constructor for Any. - */ public Any(Table table) { super(table); --- 13,16 ---- *************** *** 20,25 **** /** ! * Returns the identifierType. ! * @return Type */ public Type getIdentifierType() { --- 18,22 ---- /** ! * Returns the identifier type. */ public Type getIdentifierType() { *************** *** 28,33 **** /** ! * Sets the identifierType. ! * @param identifierType The identifierType to set */ public void setIdentifierType(Type identifierType) { --- 25,29 ---- /** ! * Sets the identifier type. */ public void setIdentifierType(Type identifierType) { Index: Property.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Property.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Property.java 2 Feb 2003 00:29:06 -0000 1.9 --- Property.java 8 Apr 2003 09:49:31 -0000 1.10 *************** *** 47,52 **** public Cascades.CascadeStyle getCascadeStyle() throws MappingException { ! if ( value.getType().isComponentType() ) { ! AbstractComponentType actype = (AbstractComponentType) value.getType(); int length = actype.getSubtypes().length; for ( int i=0; i<length; i++ ) { --- 47,53 ---- public Cascades.CascadeStyle getCascadeStyle() throws MappingException { ! Type type = value.getType(); ! if ( type.isComponentType() && !type.isObjectType() ) { ! AbstractComponentType actype = (AbstractComponentType) type; int length = actype.getSubtypes().length; for ( int i=0; i<length; i++ ) { *************** *** 62,66 **** return Cascades.STYLE_NONE; } ! else if ( cascade.equals("save/update") || cascade.equals("save-update") ) { return Cascades.STYLE_EXCEPT_DELETE; } --- 63,67 ---- return Cascades.STYLE_NONE; } ! else if ( cascade.equals("save-update") ) { return Cascades.STYLE_EXCEPT_DELETE; } |
From: <one...@us...> - 2003-04-08 09:50:04
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/impl Modified Files: FilterImpl.java QueryImpl.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: FilterImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/FilterImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FilterImpl.java 14 Jan 2003 13:42:11 -0000 1.5 --- FilterImpl.java 8 Apr 2003 09:49:29 -0000 1.6 *************** *** 1,6 **** --- 1,8 ---- package net.sf.hibernate.impl; + import java.util.HashMap; import java.util.Iterator; import java.util.List; + import java.util.Map; import net.sf.hibernate.HibernateException; *************** *** 26,32 **** */ public Iterator iterate() throws HibernateException { ! getValues().add(0, null); ! getTypes().add(0, null); ! return getSession().iterateFilter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } --- 28,34 ---- */ public Iterator iterate() throws HibernateException { ! Map namedParams = new HashMap( getNamedParams() ); ! String query = bindParameterLists(namedParams); ! return getSession().iterateFilter(collection, query, valueArray(), typeArray(), getSelection(), namedParams); } *************** *** 35,41 **** */ public List list() throws HibernateException { ! getValues().add(0, null); ! getTypes().add(0, null); ! return getSession().filter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } --- 37,43 ---- */ public List list() throws HibernateException { ! Map namedParams = new HashMap( getNamedParams() ); ! String query = bindParameterLists(namedParams); ! return getSession().filter(collection, query, valueArray(), typeArray(), getSelection(), namedParams); } *************** *** 45,48 **** --- 47,66 ---- public ScrollableResults scroll() throws HibernateException { throw new UnsupportedOperationException("Can't scroll filters"); + } + + private Type[] typeArray() { + List typeList = getTypes(); + int size = typeList.size(); + Type[] result = new Type[size+1]; + for (int i=0; i<size; i++) result[i+1] = (Type) typeList.get(i); + return result; + } + + private Object[] valueArray() { + List valueList = getValues(); + int size = valueList.size(); + Object[] result = new Object[size+1]; + for (int i=0; i<size; i++) result[i+1] = valueList.get(i); + return result; } Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** QueryImpl.java 13 Mar 2003 03:16:00 -0000 1.12 --- QueryImpl.java 8 Apr 2003 09:49:30 -0000 1.13 *************** *** 52,57 **** public Iterator iterate() throws HibernateException { ! Map namedParams = new HashMap(); ! namedParams.putAll(namedParameters); String query = bindParameterLists(namedParams); return session.iterate(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); --- 52,56 ---- public Iterator iterate() throws HibernateException { ! Map namedParams = new HashMap(namedParameters); String query = bindParameterLists(namedParams); return session.iterate(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); *************** *** 59,64 **** public ScrollableResults scroll() throws HibernateException { ! Map namedParams = new HashMap(); ! namedParams.putAll(namedParameters); String query = bindParameterLists(namedParams); return session.scroll(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); --- 58,62 ---- public ScrollableResults scroll() throws HibernateException { ! Map namedParams = new HashMap(namedParameters); String query = bindParameterLists(namedParams); return session.scroll(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); *************** *** 66,71 **** public List list() throws HibernateException { ! Map namedParams = new HashMap(); ! namedParams.putAll(namedParameters); String query = bindParameterLists(namedParams); return session.find(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); --- 64,68 ---- public List list() throws HibernateException { ! Map namedParams = new HashMap(namedParameters); String query = bindParameterLists(namedParams); return session.find(query, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); *************** *** 357,361 **** } ! private String bindParameterLists(Map namedParams) { Iterator iter = namedParameterLists.entrySet().iterator(); String query = queryString; --- 354,358 ---- } ! protected String bindParameterLists(Map namedParams) { Iterator iter = namedParameterLists.entrySet().iterator(); String query = queryString; |
From: <one...@us...> - 2003-04-08 09:50:04
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/loader Modified Files: Loader.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Loader.java 2 Apr 2003 01:06:53 -0000 1.16 --- Loader.java 8 Apr 2003 09:49:30 -0000 1.17 *************** *** 116,121 **** final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session ); ! final ResultSet rs = getResultSet(st, namedParams, selection, session); if (collection) optionalCollection.beginRead(); --- 116,121 ---- final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, namedParams, selection, false, session ); ! final ResultSet rs = getResultSet(st, selection, session); if (collection) optionalCollection.beginRead(); *************** *** 372,378 **** /** ! * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> parameters */ ! protected final PreparedStatement prepareQueryStatement(String sql, Object[] values, Type[] types, RowSelection selection, boolean scroll, SessionImplementor session) throws SQLException, HibernateException { boolean scrollable = selection!=null && --- 372,378 ---- /** ! * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> and named parameters */ ! protected final PreparedStatement prepareQueryStatement(String sql, Object[] values, Type[] types, Map namedParams, RowSelection selection, boolean scroll, SessionImplementor session) throws SQLException, HibernateException { boolean scrollable = selection!=null && *************** *** 392,395 **** --- 392,397 ---- } + if (namedParams!=null) bindNamedParameters(st, namedParams, values.length, session); + } catch (SQLException sqle) { *************** *** 416,425 **** /** ! * Bind named parameters to the <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, ! * returning an SQL <tt>ResultSet</tt> */ ! private final ResultSet getResultSet(PreparedStatement st, Map namedParams, RowSelection selection, SessionImplementor session) throws SQLException, HibernateException { try { - bindNamedParameters(st, namedParams, session); setMaxRows(st, selection); ResultSet rs = st.executeQuery(); --- 418,426 ---- /** ! * Fetch a <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, ! * advance to the first result and return an SQL <tt>ResultSet</tt> */ ! private final ResultSet getResultSet(PreparedStatement st, RowSelection selection, SessionImplementor session) throws SQLException, HibernateException { try { setMaxRows(st, selection); ResultSet rs = st.executeQuery(); *************** *** 432,439 **** throw sqle; } - catch (HibernateException he) { - closePreparedStatement(st, selection, session); - throw he; - } } --- 433,436 ---- *************** *** 454,458 **** * superclass and should be implemented by subclasses (queries) which allow named parameters. */ ! protected void bindNamedParameters(PreparedStatement st, Map namedParams, SessionImplementor session) throws SQLException, HibernateException {} /** --- 451,455 ---- * superclass and should be implemented by subclasses (queries) which allow named parameters. */ ! protected void bindNamedParameters(PreparedStatement st, Map namedParams, int start, SessionImplementor session) throws SQLException, HibernateException {} /** |
From: <one...@us...> - 2003-04-08 09:50:02
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/hql Modified Files: QueryTranslator.java SelectParser.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** QueryTranslator.java 3 Apr 2003 12:34:24 -0000 1.23 --- QueryTranslator.java 8 Apr 2003 09:49:27 -0000 1.24 *************** *** 701,705 **** } ! protected void bindNamedParameters(PreparedStatement ps, Map namedParams, SessionImplementor session) throws SQLException, HibernateException { if (namedParams!=null) { Iterator iter = namedParams.entrySet().iterator(); --- 701,705 ---- } ! protected void bindNamedParameters(PreparedStatement ps, Map namedParams, int start, SessionImplementor session) throws SQLException, HibernateException { if (namedParams!=null) { Iterator iter = namedParams.entrySet().iterator(); *************** *** 710,714 **** int[] locs = getNamedParameterLocs(name); for ( int i=0; i<locs.length; i++ ) { ! typedval.getType().nullSafeSet( ps, typedval.getValue(), locs[i], session ); } } --- 710,714 ---- int[] locs = getNamedParameterLocs(name); for ( int i=0; i<locs.length; i++ ) { ! typedval.getType().nullSafeSet( ps, typedval.getValue(), locs[i] + start, session ); } } *************** *** 718,724 **** public Iterator iterate(Object[] values, Type[] types, RowSelection selection, Map namedParams, SessionImplementor session) throws HibernateException, SQLException { ! PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session ); try { - bindNamedParameters(st, namedParams, session); setMaxRows(st, selection); ResultSet rs = st.executeQuery(); --- 718,723 ---- public Iterator iterate(Object[] values, Type[] types, RowSelection selection, Map namedParams, SessionImplementor session) throws HibernateException, SQLException { ! PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, namedParams, selection, false, session ); try { setMaxRows(st, selection); ResultSet rs = st.executeQuery(); *************** *** 735,741 **** public ScrollableResults scroll(Object[] values, Type[] types, RowSelection selection, Map namedParams, SessionImplementor session) throws HibernateException, SQLException { ! PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, true, session ); try { - bindNamedParameters(st, namedParams, session); setMaxRows(st, selection); ResultSet rs = st.executeQuery(); --- 734,739 ---- public ScrollableResults scroll(Object[] values, Type[] types, RowSelection selection, Map namedParams, SessionImplementor session) throws HibernateException, SQLException { ! PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, namedParams, selection, true, session ); try { setMaxRows(st, selection); ResultSet rs = st.executeQuery(); Index: SelectParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/SelectParser.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SelectParser.java 6 Apr 2003 10:11:09 -0000 1.9 --- SelectParser.java 8 Apr 2003 09:49:29 -0000 1.10 *************** *** 2,10 **** --- 2,14 ---- package net.sf.hibernate.hql; + import java.sql.Types; import java.util.HashSet; import java.util.Set; + import net.sf.hibernate.AssertionFailure; import net.sf.hibernate.Hibernate; + import net.sf.hibernate.MappingException; import net.sf.hibernate.QueryException; + import net.sf.hibernate.type.Type; import net.sf.hibernate.util.StringHelper; *************** *** 32,35 **** --- 36,40 ---- private boolean aggregate; private boolean count; + private boolean avg; private boolean first; private boolean afterNew; *************** *** 104,110 **** if (!ready) throw new QueryException(", expected before aggregate function in SELECT: " + token); if ( lctoken.equals("count") ) { ! q.addSelectScalar(Hibernate.INTEGER); count = true; } aggregate = true; ready = false; --- 109,118 ---- if (!ready) throw new QueryException(", expected before aggregate function in SELECT: " + token); if ( lctoken.equals("count") ) { ! q.addSelectScalar(Hibernate.INTEGER); //must be handled differently 'cos of count(*) count = true; } + else if ( lctoken.equals("avg") ) { + avg = true; + } aggregate = true; ready = false; *************** *** 122,126 **** } q.appendScalarSelectToken( aggregatePathExpressionParser.getWhereColumn() ); ! if (!count) q.addSelectScalar( aggregatePathExpressionParser.getWhereColumnType() ); aggregatePathExpressionParser.addAssociation(q); } --- 130,134 ---- } q.appendScalarSelectToken( aggregatePathExpressionParser.getWhereColumn() ); ! if (!count) q.addSelectScalar( aggregateType( aggregatePathExpressionParser.getWhereColumnType(), q ) ); aggregatePathExpressionParser.addAssociation(q); } *************** *** 146,149 **** --- 154,184 ---- } + public Type aggregateType(Type type, QueryTranslator q) throws QueryException { + if (count) { + throw new AssertionFailure("count(*) must be handled differently"); + } + else if (avg) { + int[] sqlTypes; + try { + sqlTypes = type.sqlTypes(q.factory); + } + catch (MappingException me) { + throw new QueryException(me); + } + if (sqlTypes.length!=1) throw new QueryException("multi-column type in avg()"); + int sqlType = sqlTypes[0]; + if ( sqlType==Types.INTEGER || sqlType==Types.BIGINT || sqlType==Types.TINYINT ) { + return Hibernate.FLOAT; + } + else { + return type; + } + + } + else { + return type; + } + } + public void start(QueryTranslator q) { ready=true; *************** *** 151,154 **** --- 186,190 ---- aggregate=false; count = false; + avg = false; afterNew = false; holderClass = null; |
From: <one...@us...> - 2003-04-08 09:50:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/engine Modified Files: Cascades.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Cascades.java 6 Apr 2003 02:28:57 -0000 1.9 --- Cascades.java 8 Apr 2003 09:49:27 -0000 1.10 *************** *** 211,215 **** if ( type.isAssociationType() ) { if ( ( (AssociationType) type ).getForeignKeyType().cascadeNow(cascadeTo) ) { ! if ( type.isEntityType() ) { action.cascade(session, child); } --- 211,215 ---- if ( type.isAssociationType() ) { if ( ( (AssociationType) type ).getForeignKeyType().cascadeNow(cascadeTo) ) { ! if ( type.isEntityType() || type.isObjectType() ) { action.cascade(session, child); } |
From: <one...@us...> - 2003-04-08 09:50:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate Modified Files: CompositeUserType.java hibernate-mapping-2.0.dtd Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: CompositeUserType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/CompositeUserType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompositeUserType.java 6 Apr 2003 10:16:48 -0000 1.1 --- CompositeUserType.java 8 Apr 2003 09:49:25 -0000 1.2 *************** *** 21,25 **** * <br> * Implementors must be immutable and must declare a public ! * default constructor. * * @see UserType for more simple cases --- 21,30 ---- * <br> * Implementors must be immutable and must declare a public ! * default constructor.<br> ! * <br> ! * Unlike <tt>UserType</tt>, cacheability does not depend upon ! * serializability. Instead, <tt>assemble()</tt> and ! * <tt>disassemble</tt> provide conversion to/from a cacheable ! * representation. * * @see UserType for more simple cases *************** *** 27,30 **** --- 32,36 ---- */ public interface CompositeUserType { + /** * Get the "property names" that may be used in a *************** *** 66,70 **** * @return int[] the typecodes */ ! public int[] sqlTypes(); /** --- 72,76 ---- * @return int[] the typecodes */ ! //public int[] sqlTypes(); /** *************** *** 133,137 **** /** * Transform the object into its cacheable representation. At the very least this ! * method should perform a deep copy. That may not be enough for some implementation, * however; for example, associations must be cached as identifier values. (optional * operation) --- 139,143 ---- /** * Transform the object into its cacheable representation. At the very least this ! * method should perform a deep copy. That may not be enough for some implementations, * however; for example, associations must be cached as identifier values. (optional * operation) Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** hibernate-mapping-2.0.dtd 6 Apr 2003 02:28:55 -0000 1.21 --- hibernate-mapping-2.0.dtd 8 Apr 2003 09:49:26 -0000 1.22 *************** *** 183,186 **** --- 183,187 ---- <!ATTLIST any id-type CDATA #REQUIRED> <!ATTLIST any name CDATA #REQUIRED> + <!ATTLIST any cascade (none|save-update|all) "none"> <!-- A component is a user-defined class, persisted along with its containing entity |
From: <one...@us...> - 2003-04-08 09:49:45
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/type Modified Files: CompositeCustomType.java ObjectType.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: CompositeCustomType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/CompositeCustomType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompositeCustomType.java 6 Apr 2003 10:11:12 -0000 1.2 --- CompositeCustomType.java 8 Apr 2003 09:49:34 -0000 1.3 *************** *** 113,117 **** public int getColumnSpan(Mapping mapping) throws MappingException { ! return userType.sqlTypes().length; } --- 113,122 ---- public int getColumnSpan(Mapping mapping) throws MappingException { ! Type[] types = userType.getPropertyTypes(); ! int n=0; ! for (int i=0; i<types.length; i++) { ! n+=types[i].getColumnSpan(mapping); ! } ! return n; } *************** *** 164,168 **** public int[] sqlTypes(Mapping mapping) throws MappingException { ! return userType.sqlTypes(); } --- 169,180 ---- public int[] sqlTypes(Mapping mapping) throws MappingException { ! Type[] types = userType.getPropertyTypes(); ! int[] result = new int[ getColumnSpan(mapping) ]; ! int n=0; ! for (int i=0; i<types.length; i++) { ! int[] sqlTypes = types[i].sqlTypes(mapping); ! for ( int k=0; k<sqlTypes.length; k++ ) result[n++] = sqlTypes[k]; ! } ! return result; } Index: ObjectType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ObjectType.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectType.java 6 Apr 2003 10:11:13 -0000 1.8 --- ObjectType.java 8 Apr 2003 09:49:35 -0000 1.9 *************** *** 19,23 **** import net.sf.hibernate.util.ArrayHelper; ! public class ObjectType extends AbstractType implements AbstractComponentType { private Type identifierType; --- 19,23 ---- import net.sf.hibernate.util.ArrayHelper; ! public class ObjectType extends AbstractType implements AbstractComponentType, AssociationType { private Type identifierType; *************** *** 241,244 **** --- 241,253 ---- public boolean isComponentType() { + return true; + } + + public ForeignKeyType getForeignKeyType() { + //return AssociationType.FOREIGN_KEY_TO_PARENT; //TODO: this is better but causes a transient object exception... + return AssociationType.FOREIGN_KEY_FROM_PARENT; + } + + public boolean isAssociationType() { return true; } |
From: <one...@us...> - 2003-04-06 15:02:07
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv7415 Modified Files: Configuration.java Log Message: applied Max Andersen's patch to allow configuration by various means: Index: Configuration.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Configuration.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Configuration.java 4 Apr 2003 13:51:59 -0000 1.19 --- Configuration.java 6 Apr 2003 15:02:01 -0000 1.20 *************** *** 10,17 **** --- 10,21 ---- import java.util.jar.JarFile; import java.util.zip.ZipEntry; + import java.io.File; + import java.io.FileInputStream; + import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; import java.io.StringReader; + import java.net.URL; import org.apache.commons.logging.Log; *************** *** 172,175 **** --- 176,195 ---- /** + * Read mappings from a <tt>URL</tt> + * @param url + */ + public Configuration addURL(URL url) throws MappingException { + if ( log.isDebugEnabled() ) log.debug("Mapping URL:\n" + url); + try { + addInputStream( url.openStream() ); + } + catch (Exception e) { + log.error("Could not configure datastore from URL", e); + throw new MappingException(e); + } + return this; + } + + /** * Read mappings from a DOM <tt>Document</tt> * @param doc a DOM document *************** *** 187,191 **** } ! private void add(org.dom4j.Document doc) throws Exception { try { Binder.bindRoot( doc, createMappings() ); --- 207,211 ---- } ! protected void add(org.dom4j.Document doc) throws Exception { try { Binder.bindRoot( doc, createMappings() ); *************** *** 670,687 **** * Use the mappings and properties specified in the given application * resource. The format of the resource is defined in ! * <tt>hibernate-configuration.dtd</tt>. */ public Configuration configure(String resource) throws HibernateException { - InputStream stream = getConfigurationInputStream(resource); org.dom4j.Document doc; try { ! doc = XMLHelper.createSAXReader(resource).read( new InputSource(stream) ); } catch (Exception e) { ! log.error("Problem parsing configuration " + resource, e); ! throw new HibernateException( "Problem parsing configuration " + resource + ": " + e ); } Element sfNode = doc.getRootElement().element("session-factory"); --- 690,788 ---- * Use the mappings and properties specified in the given application * resource. The format of the resource is defined in ! * <tt>hibernate-configuration-2.0.dtd</tt>. ! * ! * The resource is found via <tt>getConfigurationInputStream(resource)</tt>. */ public Configuration configure(String resource) throws HibernateException { InputStream stream = getConfigurationInputStream(resource); + return configure(stream, resource); + } + + /** + * Use the mappings and properties specified in the given document. + * The format of the document is defined in + * <tt>hibernate-configuration-2.0.dtd</tt>. + * + * @param url URL from which you wish to load the configuration + * @return A configuration configured via the file + * @throws HibernateException + */ + public Configuration configure(URL url) throws HibernateException { + try { + return configure( url.openStream(), url.toString() ); + } + catch (IOException ioe) { + throw new HibernateException("could not configure from URL: " + url, ioe); + } + } + + /** + * Use the mappings and properties specified in the given application + * file. The format of the file is defined in + * <tt>hibernate-configuration-2.0.dtd</tt>. + * + * @param configFile <tt>File</tt> from which you wish to load the configuration + * @return A configuration configured via the file + * @throws HibernateException + */ + public Configuration configure(File configFile) throws HibernateException { + try { + return configure( new FileInputStream(configFile), configFile.toString() ); + } + catch (FileNotFoundException fnfe) { + throw new HibernateException("could not find file: " + configFile, fnfe); + } + } + + /** + * Use the mappings and properties specified in the given application + * resource. The format of the resource is defined in + * <tt>hibernate-configuration-2.0.dtd</tt>. + * + * @param stream Inputstream to be read from + * @param resourceName The name to use in warning/error messages + * @return A configuration configured via the stream + * @throws HibernateException + */ + protected Configuration configure(InputStream stream, String resourceName) throws HibernateException { + + org.dom4j.Document doc; + try { + doc = XMLHelper.createSAXReader(resourceName).read( new InputSource(stream) ); + } + catch (Exception e) { + log.error("problem parsing configuration" + resourceName, e); + throw new HibernateException("problem parsing configuration" + resourceName, e); + } + + return configure(doc); + } + + /** + * Use the mappings and properties specified in the given XML document. + * The format of the file is defined in + * <tt>hibernate-configuration-2.0.dtd</tt>. + * + * @param document an XML document from which you wish to load the configuration + * @return A configuration configured via the <tt>Document</tt> + * @throws HibernateException + * @throws FileNotFoundException if there is problem in accessing the file. + */ + public Configuration configure(Document document) throws HibernateException { + org.dom4j.Document doc; try { ! doc = XMLHelper.createDOMReader().read(document); } catch (Exception e) { ! log.error("problem parsing document", e); ! throw new HibernateException("problem parsing document", e); } + + return configure(doc); + } + + protected Configuration configure(org.dom4j.Document doc) throws HibernateException { Element sfNode = doc.getRootElement().element("session-factory"); |
From: <one...@us...> - 2003-04-06 14:20:16
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen In directory sc8-pr-cvs1:/tmp/cvs-serv21331/codegen Modified Files: ClassMapping.java Log Message: applied max andersen's timestamp patch Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/ClassMapping.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ClassMapping.java 30 Dec 2002 11:55:09 -0000 1.23 --- ClassMapping.java 6 Apr 2003 14:20:11 -0000 1.24 *************** *** 131,135 **** type = property.getAttributeValue("class"); } ! if ( type == null || type.trim().equals("") ) { System.out.println("property \"" + name + "\" in class " + getName() + " is missing a type attribute"); continue; --- 131,138 ---- type = property.getAttributeValue("class"); } ! if ("timestamp".equals(property.getName())){ ! type = "java.util.Date"; ! } ! if ( type == null || type.trim().equals("") ) { System.out.println("property \"" + name + "\" in class " + getName() + " is missing a type attribute"); continue; |
From: <one...@us...> - 2003-04-06 11:03:15
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv9603/reference/src Modified Files: advanced_or_mapping.xml Log Message: documented nonstrict-read-write cache Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** advanced_or_mapping.xml 29 Mar 2003 13:31:22 -0000 1.13 --- advanced_or_mapping.xml 6 Apr 2003 11:03:12 -0000 1.14 *************** *** 968,980 **** <programlistingco> <areaspec> ! <area id="cache1" coords="1 40"/> </areaspec> ! <programlisting><![CDATA[<jcs-cache usage="read-write|read-only" />]]></programlisting> <calloutlist> <callout arearefs="cache1"> <para> ! <literal>usage</literal> specifies the caching strategy ! (<literal>read-write</literal>, ! <literal>read-only</literal>) </para> </callout> --- 968,981 ---- <programlistingco> <areaspec> ! <area id="cache1" coords="1 61"/> </areaspec> ! <programlisting><![CDATA[<jcs-cache usage="read-write|nonstrict-read-write|read-only" />]]></programlisting> <calloutlist> <callout arearefs="cache1"> <para> ! <literal>usage</literal> specifies the caching strategy: ! <literal>read-write</literal>, ! <literal>nonstrict-read-write</literal> or ! <literal>read-only</literal> </para> </callout> *************** *** 1025,1028 **** --- 1026,1044 ---- </set> </class>]]></programlisting> + + </sect2> + + <sect2 id="adv-or-mapping-s3-3"> + <title>Nonstrict Read / Write Cache</title> + + <para> + If the application occasionally needs to update data and strict transaction isolation is + not required, a <literal>nonstrict-read-write</literal> cache might be appropriate. This cache + may be used in a clustered environment when JCS distributed caching is configured. If the + cache is used in a JTA environment, you must specify + <literal>hibernate.transaction.manager_lookup_class</literal>. In other environments, you should + ensure that the transaction is completed when <literal>Session.close()</literal> or + <literal>Session.disconnect()</literal> is called. + </para> </sect2> |
From: <one...@us...> - 2003-04-06 10:41:47
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv3447/reference/src Modified Files: basic_or_mapping.xml Log Message: updated for latest changes Index: basic_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/basic_or_mapping.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** basic_or_mapping.xml 30 Mar 2003 06:40:17 -0000 1.12 --- basic_or_mapping.xml 6 Apr 2003 10:41:43 -0000 1.13 *************** *** 414,418 **** <listitem> <para> ! Picks <literal>identity</literal>, <literal>sequence</literal> or <literal>hilo</literal> depending upon the capabilities of the underlying database. --- 414,418 ---- <listitem> <para> ! picks <literal>identity</literal>, <literal>sequence</literal> or <literal>hilo</literal> depending upon the capabilities of the underlying database. *************** *** 429,432 **** --- 429,441 ---- </listitem> </varlistentry> + <varlistentry> + <term><literal>foreign</literal></term> + <listitem> + <para> + uses the identifier of another associated object. Used in conjunction + with a <literal><one-to-one></literal> association. + </para> + </listitem> + </varlistentry> </variablelist> *************** *** 528,533 **** <programlisting><![CDATA[<composite-id> ! <property name="medicareNumber"/> ! <property name="dependent"/> </composite-id>]]></programlisting> --- 537,542 ---- <programlisting><![CDATA[<composite-id> ! <key-property name="medicareNumber"/> ! <key-property name="dependent"/> </composite-id>]]></programlisting> *************** *** 995,1003 **** <programlistingco> <areaspec> ! <area id="component1" coords="1 31"/> ! <area id="component2" coords="1 49"/> </areaspec> ! <programlisting><![CDATA[<component name="propertyName" class="className" > <property ...../> ........ </component>]]></programlisting> --- 1004,1020 ---- <programlistingco> <areaspec> ! <area id="component1" coords="2 33"/> ! <area id="component2" coords="3 33"/> ! <area id="component3" coords="4 33"/> ! <area id="component4" coords="5 33"/> </areaspec> ! <programlisting><![CDATA[<component ! name="propertyName" ! class="className" ! insert="true|false" ! upate="true|false"> ! <property ...../> + <many-to-one .... /> ........ </component>]]></programlisting> *************** *** 1014,1017 **** --- 1031,1046 ---- </para> </callout> + <callout arearefs="component3"> + <para> + <literal>insert</literal>: Do the mapped columns appear in SQL + <literal>INSERT</literal>s? + </para> + </callout> + <callout arearefs="component4"> + <para> + <literal>update</literal>: Do the mapped columns appear in SQL + <literal>UPDATE</literal>s? + </para> + </callout> </calloutlist> </programlistingco> *************** *** 1390,1415 **** <programlisting><![CDATA[package eg; ! import net.sf.hibernate.PersistentEnum; ! public class Color implements PersistentEnum { ! private final int code; ! private Color(int code) { ! this.code = code; ! } ! public static final Color TABBY = new Color(0); ! public static final Color GINGER = new Color(1); ! public static final Color BLACK = new Color(2); ! public int toInt() { return code; } ! public static Color fromInt(int code) { ! switch (code) { ! case 0: return TABBY; ! case 1: return GINGER; ! case 2: return BLACK; ! default: throw new RuntimeException("Unknown color code"); ! } ! } ! }]]></programlisting> <para> --- 1419,1444 ---- <programlisting><![CDATA[package eg; ! import net.sf.hibernate.PersistentEnum; ! public class Color implements PersistentEnum { ! private final int code; ! private Color(int code) { ! this.code = code; ! } ! public static final Color TABBY = new Color(0); ! public static final Color GINGER = new Color(1); ! public static final Color BLACK = new Color(2); ! public int toInt() { return code; } ! public static Color fromInt(int code) { ! switch (code) { ! case 0: return TABBY; ! case 1: return GINGER; ! case 2: return BLACK; ! default: throw new RuntimeException("Unknown color code"); ! } ! } ! }]]></programlisting> <para> *************** *** 1433,1441 **** <literal>FIRST_NAME</literal>, <literal>INITIAL</literal>, <literal>SURNAME</literal>. </para> <para> ! To implement a custom type, implement the interface <literal>net.sf.hibernate.UserType</literal> ! and simply declare properties using the fully qualified classname of the type. Check out ! <literal>net.sf.hibernate.test.DoubleStringType</literal> to see the kind of things ! that are possible. </para> --- 1462,1472 ---- <literal>FIRST_NAME</literal>, <literal>INITIAL</literal>, <literal>SURNAME</literal>. </para> + <para> ! To implement a custom type, implement either <literal>net.sf.hibernate.UserType</literal> ! or <literal>net.sf.hibernate.CompositeUserType</literal> and declare properties using the ! fully qualified classname of the type. Check out ! <literal>net.sf.hibernate.test.DoubleStringType</literal> to see the kind of things that ! are possible. </para> |
From: <one...@us...> - 2003-04-06 10:16:52
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv29200/test Added Files: Multiplicity.java MultiplicityType.java Log Message: added CompositeUserType --- NEW FILE: Multiplicity.java --- package net.sf.hibernate.test; import java.io.Serializable; public class Multiplicity implements Serializable { public int count; public Glarch glarch; } --- NEW FILE: MultiplicityType.java --- package net.sf.hibernate.test; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import net.sf.hibernate.CompositeUserType; import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionImplementor; import net.sf.hibernate.type.Type; public class MultiplicityType implements CompositeUserType { private static final String[] PROP_NAMES = new String[] { "count", "glarch" }; private static final int[] SQL_TYPES = new int[] { Hibernate.INTEGER.sqlType(), Hibernate.STRING.sqlType() }; private static final Type[] TYPES = new Type[] { Hibernate.INTEGER, Hibernate.association(Glarch.class) }; public String[] getPropertyNames() { return PROP_NAMES; } public Type[] getPropertyTypes() { return TYPES; } public Object getPropertyValue(Object component, int property) { Multiplicity o = (Multiplicity) component; return property==0 ? (Object) new Integer(o.count) : (Object) o.glarch; } public void setPropertyValue( Object component, int property, Object value) { Multiplicity o = (Multiplicity) component; if (property==0) { o.count = ( (Integer) value ).intValue(); } else { o.glarch = (Glarch) value; } } public int[] sqlTypes() { return SQL_TYPES; } public Class returnedClass() { return Multiplicity.class; } public boolean equals(Object x, Object y) { Multiplicity mx = (Multiplicity) x; Multiplicity my = (Multiplicity) y; if (mx==my) return true; if (mx==null || my==null) return false; return mx.count==my.count && mx.glarch==my.glarch; } public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { Integer c = (Integer) Hibernate.INTEGER.nullSafeGet( rs, names[0] ); Glarch g = (Glarch) Hibernate.association(Glarch.class).nullSafeGet(rs, names[1], session, owner); Multiplicity m = new Multiplicity(); m.count = c==null ? 0 : c.intValue(); m.glarch = g; return m; } public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { Multiplicity o = (Multiplicity) value; Glarch g; Integer c; if (o==null) { g=null; c=new Integer(0); } else { g = o.glarch; c = new Integer(o.count); } Hibernate.INTEGER.nullSafeSet(st, c, index, session); Hibernate.association(Glarch.class).nullSafeSet(st, g, index+1, session); } public Object deepCopy(Object value) { if (value==null) return null; Multiplicity v = (Multiplicity) value; Multiplicity m = new Multiplicity(); m.count = v.count; m.glarch = m.glarch; return m; } public boolean isMutable() { return true; } public Object assemble( Serializable cached, SessionImplementor session, Object owner) { throw new UnsupportedOperationException(); } public Serializable disassemble(Object value, SessionImplementor session) { throw new UnsupportedOperationException(); } } |
From: <one...@us...> - 2003-04-06 10:16:52
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv29200 Added Files: CompositeUserType.java Log Message: added CompositeUserType --- NEW FILE: CompositeUserType.java --- //$Id: CompositeUserType.java,v 1.1 2003/04/06 10:16:48 oneovthafew Exp $ package net.sf.hibernate; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import net.sf.hibernate.engine.SessionImplementor; import net.sf.hibernate.type.Type; /** * A <tt>UserType</tt> that may be dereferenced in a query. * This interface allows a custom type to define "properties". * These need not necessarily correspond to physical JavaBeans * style properties.<br> * <br> * A <tt>CompositeUserType</tt> may be used in almost every way * that a component may be used. It may even contain many-to-one * associations.<br> * <br> * Implementors must be immutable and must declare a public * default constructor. * * @see UserType for more simple cases * @see net.sf.hibernate.type.Type */ public interface CompositeUserType { /** * Get the "property names" that may be used in a * query. * * @return an array of "property names" */ public String[] getPropertyNames(); /** * Get the corresponding "property types" * * @return an array of Hibernate types */ public Type[] getPropertyTypes(); /** * Get the value of a property * * @param component an instance of class mapped by this "type" * @param property * @return the property value */ public Object getPropertyValue(Object component, int property) throws HibernateException; /** * Set the value of a property * * @param component an instance of class mapped by this "type" * @param property * @param value the value to set */ public void setPropertyValue(Object component, int property, Object value) throws HibernateException; /** * Return the SQL type codes for the columns mapped by this type. The * codes are defined on <tt>java.sql.Types</tt>. * @see java.sql.Types * @return int[] the typecodes */ public int[] sqlTypes(); /** * The class returned by <tt>nullSafeGet()</tt>. * * @param session * @return Class */ public Class returnedClass(); /** * Compare two instances of the class mapped by this type for persistence * "equality", ie. equality of persistent state. * * @param x * @param y * @return boolean */ public boolean equals(Object x, Object y) throws HibernateException; /** * Retrieve an instance of the mapped class from a JDBC resultset. Implementors * should handle possibility of null values. * * @param rs a JDBC result set * @param names the column names * @param session * @param owner the containing entity * @return Object * @throws HibernateException * @throws SQLException */ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException; /** * Write an instance of the mapped class to a prepared statement. Implementors * should handle possibility of null values. A multi-column type should be written * to parameters starting from <tt>index</tt>. * * @param st a JDBC prepared statement * @param value the object to write * @param index statement parameter index * @param session * @throws HibernateException * @throws SQLException */ public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException; /** * Return a deep copy of the persistent state, stopping at entities and at * collections. * * @param value generally a collection element or entity field * @param session * @return Object a copy */ public Object deepCopy(Object value) throws HibernateException; /** * Are objects of this type mutable? * * @return boolean */ public boolean isMutable(); /** * Transform the object into its cacheable representation. At the very least this * method should perform a deep copy. That may not be enough for some implementation, * however; for example, associations must be cached as identifier values. (optional * operation) * * @param value the object to be cached * @param session * @return */ public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException; /** * Reconstruct an object from the cacheable representation. At the very least this * method should perform a deep copy. (optional operation) * * @param value the object to be cached * @param session * @return */ public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException; } |
From: <one...@us...> - 2003-04-06 10:11:44
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv26833/proxy Modified Files: LazyInitializer.java Log Message: * reworked CompositeUserType * improved some exception handling Index: LazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/LazyInitializer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LazyInitializer.java 5 Apr 2003 07:48:45 -0000 1.7 --- LazyInitializer.java 6 Apr 2003 10:11:10 -0000 1.8 *************** *** 86,90 **** } ! else if ( !overridesEquals && "hashCode".equals(methodName) ) { // kinda dodgy, since it redefines the hashcode of the proxied object. // but necessary if we are to keep proxies in HashSets without --- 86,90 ---- } ! else if ( !overridesEquals && getIdentifierMethod!=null && "hashCode".equals(methodName) ) { // kinda dodgy, since it redefines the hashcode of the proxied object. // but necessary if we are to keep proxies in HashSets without *************** *** 100,104 **** } ! else if ( params==1 && !overridesEquals && "equals".equals(methodName) ) { // less dodgy because Hibernate forces == to be same as identifier equals return new Boolean( id.equals( getIdentifierMethod.invoke( args[0], null ) ) ); --- 100,104 ---- } ! else if ( params==1 && !overridesEquals && getIdentifierMethod!=null && "equals".equals(methodName) ) { // less dodgy because Hibernate forces == to be same as identifier equals return new Boolean( id.equals( getIdentifierMethod.invoke( args[0], null ) ) ); |
From: <one...@us...> - 2003-04-06 10:11:43
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv26833/persister Modified Files: NormalizedEntityPersister.java Log Message: * reworked CompositeUserType * improved some exception handling Index: NormalizedEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/NormalizedEntityPersister.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NormalizedEntityPersister.java 6 Apr 2003 02:28:57 -0000 1.16 --- NormalizedEntityPersister.java 6 Apr 2003 10:11:10 -0000 1.17 *************** *** 960,963 **** --- 960,973 ---- public String[] toColumns(String alias, String property) throws QueryException { + if ( PathExpressionParser.ENTITY_CLASS.equals(property) ) { + // This doesn't actually seem to work but it *might* + // work on some dbs. Also it doesn't work if there + // are multiple columns of results because it + // is not accounting for the suffix. + // return new String[] { getDiscriminatorColumnName() }; + + return new String[] { discriminatorFragment(alias).toFragmentString() }; + } + String[] cols = getPropertyColumnNames(property); if (cols==null) throw new QueryException("unresolved property: " + property); *************** *** 998,1018 **** if ( hasSubclasses() ) { ! ! CaseFragment cases = dialect.createCaseFragment() ! .setReturnColumnName( getDiscriminatorColumnName(), suffix ); ! ! for ( int i=0; i< discriminators.length; i++ ) { ! cases.addWhenColumnNotNull( ! alias( alias, tableNumbers[i] ), ! notNullColumns[i], ! discriminators[i] ! ); ! } ! ! return ", " + cases.toFragmentString() + frag.toFragmentString(); } else { return frag.toFragmentString(); } } --- 1008,1034 ---- if ( hasSubclasses() ) { ! return ", " + ! discriminatorFragment(alias) ! .setReturnColumnName( getDiscriminatorColumnName(), suffix ) ! .toFragmentString() + ! frag.toFragmentString(); } else { return frag.toFragmentString(); } + } + + private CaseFragment discriminatorFragment(String alias) { + CaseFragment cases = dialect.createCaseFragment(); + + for ( int i=0; i< discriminators.length; i++ ) { + cases.addWhenColumnNotNull( + alias( alias, tableNumbers[i] ), + notNullColumns[i], + discriminators[i] + ); + } + + return cases; } |
From: <one...@us...> - 2003-04-06 10:11:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv26833/impl Modified Files: CacheEntry.java SessionImpl.java Log Message: * reworked CompositeUserType * improved some exception handling Index: CacheEntry.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CacheEntry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CacheEntry.java 21 Mar 2003 12:03:37 -0000 1.4 --- CacheEntry.java 6 Apr 2003 10:11:09 -0000 1.5 *************** *** 3,7 **** import java.io.Serializable; - import java.sql.SQLException; import net.sf.hibernate.AssertionFailure; --- 3,6 ---- *************** *** 22,26 **** return subclass; } ! public CacheEntry(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException, SQLException { state = disassemble(object, persister, session); subclass = object.getClass(); --- 21,25 ---- return subclass; } ! public CacheEntry(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException { state = disassemble(object, persister, session); subclass = object.getClass(); *************** *** 38,42 **** ! public Object[] assemble(Object instance, Serializable id, ClassPersister persister, SessionImplementor session) throws SQLException, HibernateException { if ( subclass!=persister.getMappedClass() ) throw new AssertionFailure("Tried to assemble a different subclass instance"); --- 37,41 ---- ! public Object[] assemble(Object instance, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException { if ( subclass!=persister.getMappedClass() ) throw new AssertionFailure("Tried to assemble a different subclass instance"); *************** *** 46,50 **** } ! private Object[] assemble(Object[] values, Object result, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException, SQLException { Type[] propertyTypes = persister.getPropertyTypes(); Object[] assembledProps = new Object[propertyTypes.length]; --- 45,49 ---- } ! private Object[] assemble(Object[] values, Object result, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException { Type[] propertyTypes = persister.getPropertyTypes(); Object[] assembledProps = new Object[propertyTypes.length]; Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** SessionImpl.java 6 Apr 2003 02:28:57 -0000 1.32 --- SessionImpl.java 6 Apr 2003 10:11:09 -0000 1.33 *************** *** 1624,1628 **** * or return a new proxy (but do return an existing proxy). Do not check if the object was deleted. */ ! public Object internalLoadOneToOne(Class clazz, Serializable id) throws SQLException, HibernateException { return doLoadByClass(clazz, id, false, false); } --- 1624,1628 ---- * or return a new proxy (but do return an existing proxy). Do not check if the object was deleted. */ ! public Object internalLoadOneToOne(Class clazz, Serializable id) throws HibernateException { return doLoadByClass(clazz, id, false, false); } *************** *** 1632,1636 **** * return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. */ ! public Object internalLoad(Class clazz, Serializable id) throws SQLException, HibernateException { Object result = doLoadByClass(clazz, id, false, true); throwObjectNotFound(result, id, clazz); --- 1632,1636 ---- * return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. */ ! public Object internalLoad(Class clazz, Serializable id) throws HibernateException { Object result = doLoadByClass(clazz, id, false, true); throwObjectNotFound(result, id, clazz); *************** *** 1790,1800 **** addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); ! Object[] values; ! try { ! values = entry.assemble(result, id, subclassPersister, this); // intializes cached by side-effect ! } ! catch (SQLException sqle) { ! throw new JDBCException("Could not reassemble cached object", sqle); ! } Type[] types = subclassPersister.getPropertyTypes(); TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); --- 1790,1794 ---- addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); ! Object[] values = entry.assemble(result, id, subclassPersister, this); // intializes cached by side-effect Type[] types = subclassPersister.getPropertyTypes(); TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); *************** *** 1853,1857 **** } ! public void initializeEntity(Object object) throws HibernateException, SQLException { EntityEntry e = getEntry(object); --- 1847,1851 ---- } ! public void initializeEntity(Object object) throws HibernateException { EntityEntry e = getEntry(object); *************** *** 2596,2600 **** } ! public void initialize(PersistentCollection collection, boolean writing) throws HibernateException, SQLException { CollectionEntry ce = getCollectionEntry(collection); --- 2590,2594 ---- } ! public void initialize(PersistentCollection collection, boolean writing) throws HibernateException { CollectionEntry ce = getCollectionEntry(collection); *************** *** 2612,2616 **** collection.beforeInitialize(persister); ! persister.getInitializer().initialize(id, collection, owner, this); //tableAccesses.add( ce.loadedPersister.getQualifiedTableName() ); ce.initialized = true; --- 2606,2615 ---- collection.beforeInitialize(persister); ! try { ! persister.getInitializer().initialize(id, collection, owner, this); ! } ! catch (SQLException sqle) { ! throw new JDBCException("SQLException initializing collection", sqle); ! } //tableAccesses.add( ce.loadedPersister.getQualifiedTableName() ); ce.initialized = true; |
From: <one...@us...> - 2003-04-06 10:11:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id In directory sc8-pr-cvs1:/tmp/cvs-serv26833/id Modified Files: Configurable.java IdentifierGenerator.java PersistentIdentifierGenerator.java Log Message: * reworked CompositeUserType * improved some exception handling Index: Configurable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/Configurable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Configurable.java 9 Jan 2003 12:24:50 -0000 1.1 --- Configurable.java 6 Apr 2003 10:11:09 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- /** * An <tt>IdentifierGenerator</tt> that supports "configuration". + * @see IdentifierGenerator */ public interface Configurable { Index: IdentifierGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdentifierGenerator.java 9 Jan 2003 12:24:50 -0000 1.4 --- IdentifierGenerator.java 6 Apr 2003 10:11:09 -0000 1.5 *************** *** 11,26 **** /** * The general contract between a class that generates unique ! * IDs and the <tt>Session</tt>. It is not intended that this ! * interface ever be exposed to the application. It <b>is</b> * intended that users implement this interface to provide ! * custom ID generation strategies.<br> * <br> ! * Implementors should provide a public constructor that takes ! * exactly as many <tt>String</tt> arguments as <tt><param> ! * </tt>elements in the mapping file.<br> * <br> * Implementors MUST be threadsafe * * @see PersistentIdentifierGenerator */ public interface IdentifierGenerator { --- 11,28 ---- /** * The general contract between a class that generates unique ! * identifiers and the <tt>Session</tt>. It is not intended that ! * this interface ever be exposed to the application. It <b>is</b> * intended that users implement this interface to provide ! * custom identifier generation strategies.<br> * <br> ! * Implementors should provide a public default constructor.<br> ! * <br> ! * Implementations that accept configuration parameters should ! * also implement <tt>Configurable</tt>. * <br> * Implementors MUST be threadsafe * * @see PersistentIdentifierGenerator + * @see Configurable */ public interface IdentifierGenerator { Index: PersistentIdentifierGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/PersistentIdentifierGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PersistentIdentifierGenerator.java 6 Apr 2003 02:28:57 -0000 1.4 --- PersistentIdentifierGenerator.java 6 Apr 2003 10:11:09 -0000 1.5 *************** *** 6,14 **** /** ! * An <tt>IdentifierGenerator</tt> that requires creation of database objects. * * @see IdentifierGenerator */ - public interface PersistentIdentifierGenerator extends IdentifierGenerator { --- 6,17 ---- /** ! * An <tt>IdentifierGenerator</tt> that requires creation of database objects.<br> ! * <br> ! * All <tt>PersistentIdentifierGenerator</tt>s that also implement ! * <tt>Configurable</tt> have access to a special mapping parameter: schema * * @see IdentifierGenerator + * @see Configurable */ public interface PersistentIdentifierGenerator extends IdentifierGenerator { |