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: <max...@us...> - 2003-04-21 16:07:06
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv8022 Modified Files: changelog.txt Log Message: updated hbm2java stuff Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** changelog.txt 21 Apr 2003 11:43:15 -0000 1.16 --- changelog.txt 21 Apr 2003 15:57:38 -0000 1.17 *************** *** 27,31 **** * removed support for hibernate.query.imports and added <import> mapping element * fixed problem in DBCP connection validation and added new config properties ! * hbm2java can now generate finder methods for persistent objects (Matt Hall) * hbm2java small fixes/refactorings to support generating more than one file per persistent object (Max Andersen) --- 27,31 ---- * removed support for hibernate.query.imports and added <import> mapping element * fixed problem in DBCP connection validation and added new config properties ! * hbm2java can now generate finder methods for persistent objects (experimental) (Matt Hall) * hbm2java small fixes/refactorings to support generating more than one file per persistent object (Max Andersen) |
From: <max...@us...> - 2003-04-21 11:43:18
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv4088 Modified Files: changelog.txt Log Message: added hbm2java contributions to changelog Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** changelog.txt 21 Apr 2003 07:04:09 -0000 1.15 --- changelog.txt 21 Apr 2003 11:43:15 -0000 1.16 *************** *** 27,30 **** --- 27,32 ---- * removed support for hibernate.query.imports and added <import> mapping element * fixed problem in DBCP connection validation and added new config properties + * hbm2java can now generate finder methods for persistent objects (Matt Hall) + * hbm2java small fixes/refactorings to support generating more than one file per persistent object (Max Andersen) Changes in version 2.0 beta 4 (22.3.2003) |
From: <one...@us...> - 2003-04-21 07:39:46
|
Update of /cvsroot/hibernate/Hibernate2/src In directory sc8-pr-cvs1:/tmp/cvs-serv20929/src Modified Files: hibernate.properties Log Message: newer properties Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/hibernate.properties,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** hibernate.properties 21 Apr 2003 07:22:11 -0000 1.16 --- hibernate.properties 21 Apr 2003 07:39:42 -0000 1.17 *************** *** 26,44 **** ## PostgreSQL ! #hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect ! #hibernate.connection.driver_class org.postgresql.Driver ! #hibernate.connection.url jdbc:postgresql:template1 ! #hibernate.connection.username pg ! #hibernate.connection.password ! #hibernate.query.substitutions yes 'Y', no 'N' ! #hibernate.default_schema template1 ## DB2 ! hibernate.dialect net.sf.hibernate.dialect.DB2Dialect ! hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver ! hibernate.connection.url jdbc:db2:test ! hibernate.connection.username db2 ! hibernate.connection.password db2 --- 26,44 ---- ## PostgreSQL ! hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect ! hibernate.connection.driver_class org.postgresql.Driver ! hibernate.connection.url jdbc:postgresql:template1 ! hibernate.connection.username pg ! hibernate.connection.password ! hibernate.query.substitutions yes 'Y', no 'N' ! ## DB2 ! #hibernate.dialect net.sf.hibernate.dialect.DB2Dialect ! #hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver ! #hibernate.connection.url jdbc:db2:test ! #hibernate.connection.username db2 ! #hibernate.connection.password db2 |
From: <one...@us...> - 2003-04-21 07:22:14
|
Update of /cvsroot/hibernate/Hibernate2/src In directory sc8-pr-cvs1:/tmp/cvs-serv14535/src Modified Files: hibernate.properties Log Message: newer properties Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/hibernate.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hibernate.properties 12 Mar 2003 12:28:57 -0000 1.15 --- hibernate.properties 21 Apr 2003 07:22:11 -0000 1.16 *************** *** 32,36 **** #hibernate.connection.password #hibernate.query.substitutions yes 'Y', no 'N' ! ## DB2 --- 32,36 ---- #hibernate.connection.password #hibernate.query.substitutions yes 'Y', no 'N' ! #hibernate.default_schema template1 ## DB2 *************** *** 162,166 **** hibernate.connection.pool_size 1 ! hibernate.statement_cache.size 0 --- 162,166 ---- hibernate.connection.pool_size 1 ! hibernate.statement_cache.size 25 *************** *** 199,203 **** #hibernate.dbcp.validationQuery select 1 from dual ! --- 199,204 ---- #hibernate.dbcp.validationQuery select 1 from dual ! #hibernate.dbcp.testOnBorrow true ! #hibernate.dbcp.testOnReturn false *************** *** 290,293 **** --- 291,299 ---- #hibernate.use_outer_join false + + + ## enable CGLIB reflection optimizer (enabled by default) + + #hibernate.cglib.use_reflection_optimizer false |
From: <one...@us...> - 2003-04-21 07:15:54
|
Update of /cvsroot/hibernate/Hibernate2/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9941/lib Modified Files: jcs.jar Log Message: newer JCS build Index: jcs.jar =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/lib/jcs.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvszCeClg and /tmp/cvssOc3Ro differ |
From: <one...@us...> - 2003-04-21 07:04:15
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv2220 Modified Files: changelog.txt readme.txt Log Message: 2.0 beta 5 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** changelog.txt 22 Mar 2003 05:39:56 -0000 1.14 --- changelog.txt 21 Apr 2003 07:04:09 -0000 1.15 *************** *** 1,4 **** --- 1,30 ---- Hibernate Changelog =================== + Changes in version 2.0 beta 5 (21.4.2003) + ----------------------------------------- + * Informix support (Steve Molitor) + * fixed a bug parsing "select new ... " queries + * deprecated "object" type in favor of <any> mappings + * added Session.contains() + * added extra DBCP config options (?) + * SessionFactory.close() now unbinds from JNDI + * added Session.evict() + * got rid of an unnecessary SQL DELETE issued when an empty collection was dereferenced + * where attribute of collection mappings no longer ignored for deletion + * improved logging + * support polymorphic associations to "embedded" composite id classes + * various bugfixes to collection filter parameter binding + * fixed some problems with proxies introduced in earlier beta versions + * fixed bug with self-reference in the case of identity column id generation + * added hibernate.cglib.use_reflection_optimizer property + * added nonstrict-read-write cache + * fixed an SQL-generation bug in new Criteria API + * added CompositeUserType + * sequence and table id generators now aware of default-schema + * added update and insert attributes to <component> element + * fixed a bug with expressions like elements(foo.bar.baz) in where clause + * more efficient Set initialization (two-phase load) + * removed support for hibernate.query.imports and added <import> mapping element + * fixed problem in DBCP connection validation and added new config properties Changes in version 2.0 beta 4 (22.3.2003) *************** *** 53,57 **** * fixed a bug in Hibernate PreparedStatement cache where maxRows and fetchSize were not cleared before re-caching * fixed a bug in HibernateService that caused a restart to fail ! * added SybaseAnywhereDialect () * added SessionFactory.close() --- 79,83 ---- * fixed a bug in Hibernate PreparedStatement cache where maxRows and fetchSize were not cleared before re-caching * fixed a bug in HibernateService that caused a restart to fail ! * added SybaseAnywhereDialect (?) * added SessionFactory.close() Index: readme.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/readme.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** readme.txt 22 Mar 2003 13:41:50 -0000 1.4 --- readme.txt 21 Apr 2003 07:04:09 -0000 1.5 *************** *** 1,5 **** Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 2.0 beta 4 22 March 2003 Instructions --- 1,5 ---- Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 2.0 beta 5 21 April 2003 Instructions |
From: <one...@us...> - 2003-04-21 06:34:50
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv12928/hibernate/impl Modified Files: SessionImpl.java Log Message: * renamed remove() to evict() Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** SessionImpl.java 21 Apr 2003 06:28:18 -0000 1.37 --- SessionImpl.java 21 Apr 2003 06:34:46 -0000 1.38 *************** *** 3027,3031 **** if (entity!=null) { removeEntry(entity); ! evictCollections(persister, entity); } } --- 3027,3031 ---- if (entity!=null) { removeEntry(entity); ! doEvict(persister, entity); } } *************** *** 3035,3050 **** if (e!=null) { removeEntity( new Key(e.id, e.persister) ); ! evictCollections(e.persister, object); } } } ! private void evictCollections(ClassPersister persister, Object object) throws HibernateException { ! if ( log.isTraceEnabled() ) log.trace( "removing from session cache " + MessageHelper.infoString(persister) ); //remove all collections for the entity evictCollections( persister.getPropertyValues(object), persister.getPropertyTypes() ); ! Cascades.cascade(this, persister, object, Cascades.ACTION_REMOVE, Cascades.CASCADE_ON_REMOVE); } --- 3035,3050 ---- if (e!=null) { removeEntity( new Key(e.id, e.persister) ); ! doEvict(e.persister, object); } } } ! private void doEvict(ClassPersister persister, Object object) throws HibernateException { ! if ( log.isTraceEnabled() ) log.trace( "evicting " + MessageHelper.infoString(persister) ); //remove all collections for the entity evictCollections( persister.getPropertyValues(object), persister.getPropertyTypes() ); ! Cascades.cascade(this, persister, object, Cascades.ACTION_EVICT, Cascades.CASCADE_ON_EVICT); } |
From: <one...@us...> - 2003-04-21 06:34:49
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv12928/hibernate/engine Modified Files: Cascades.java Log Message: * renamed remove() to evict() Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Cascades.java 21 Apr 2003 06:28:17 -0000 1.12 --- Cascades.java 21 Apr 2003 06:34:46 -0000 1.13 *************** *** 19,23 **** /** ! * Implements cascaded save / delete / update / remove * @see net.sf.hibernate.type.AssociationType */ --- 19,23 ---- /** ! * Implements cascaded save / delete / update / evict * @see net.sf.hibernate.type.AssociationType */ *************** *** 57,65 **** /** ! * @see net.sf.hibernate.Session#remove(Object) */ ! public static final CascadingAction ACTION_REMOVE = new CascadingAction() { void cascade(Session session, Object child) throws HibernateException { ! log.trace("cascading to remove()"); session.evict(child); } --- 57,65 ---- /** ! * @see net.sf.hibernate.Session#evict(Object) */ ! public static final CascadingAction ACTION_EVICT = new CascadingAction() { void cascade(Session session, Object child) throws HibernateException { ! log.trace("cascading to evict()"); session.evict(child); } *************** *** 109,116 **** public static final int CASCADE_ON_UPDATE = 0; /** ! * A cascade point that occurs just after removal of the parent entity from the * session cache */ ! public static final int CASCADE_ON_REMOVE = 0; // The allowable cascade styles for a property: --- 109,116 ---- public static final int CASCADE_ON_UPDATE = 0; /** ! * A cascade point that occurs just after eviction of the parent entity from the * session cache */ ! public static final int CASCADE_ON_EVICT = 0; // The allowable cascade styles for a property: *************** *** 128,132 **** }; /** ! * save / delete / update / remove */ public static final CascadeStyle STYLE_ALL = new CascadeStyle() { --- 128,132 ---- }; /** ! * save / delete / update / evict */ public static final CascadeStyle STYLE_ALL = new CascadeStyle() { |
From: <one...@us...> - 2003-04-21 06:28:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv6798/hibernate/engine Modified Files: Cascades.java Log Message: * renamed remove() to evict() * added lots of JavaDoc to SessionImpl * factored infoString() methods out of SessionImpl Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Cascades.java 19 Apr 2003 03:26:07 -0000 1.11 --- Cascades.java 21 Apr 2003 06:28:17 -0000 1.12 *************** *** 62,66 **** void cascade(Session session, Object child) throws HibernateException { log.trace("cascading to remove()"); ! session.remove(child); } boolean shouldCascadeCollection(Object collection) { --- 62,66 ---- void cascade(Session session, Object child) throws HibernateException { log.trace("cascading to remove()"); ! session.evict(child); } boolean shouldCascadeCollection(Object collection) { |
From: <one...@us...> - 2003-04-21 06:28:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv6798/hibernate/test Modified Files: FooBarTest.java Log Message: * renamed remove() to evict() * added lots of JavaDoc to SessionImpl * factored infoString() methods out of SessionImpl Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** FooBarTest.java 19 Apr 2003 03:26:11 -0000 1.57 --- FooBarTest.java 21 Apr 2003 06:28:18 -0000 1.58 *************** *** 1086,1090 **** s.flush(); assertTrue( s.contains(baz) ); ! s.remove(baz); assertFalse( s.contains(baz) ); Baz baz2 = (Baz) s.load( Baz.class, baz.getCode() ); --- 1086,1090 ---- s.flush(); assertTrue( s.contains(baz) ); ! s.evict(baz); assertFalse( s.contains(baz) ); Baz baz2 = (Baz) s.load( Baz.class, baz.getCode() ); *************** *** 1213,1217 **** s.find("from bar in class Bar, foo in elements(bar.baz.fooArray)"); ! if ( dialect instanceof DB2Dialect) { s.find("from foo in class Foo where lower( foo.foo.string ) = 'foo'"); s.find("from foo in class Foo where lower( (foo.foo.string || 'foo') || 'bar' ) = 'foo'"); --- 1213,1217 ---- s.find("from bar in class Bar, foo in elements(bar.baz.fooArray)"); ! if (dialect instanceof DB2Dialect) { s.find("from foo in class Foo where lower( foo.foo.string ) = 'foo'"); s.find("from foo in class Foo where lower( (foo.foo.string || 'foo') || 'bar' ) = 'foo'"); *************** *** 1219,1222 **** --- 1219,1225 ---- s.find("from foo in class Bar where foo.foo.integer is not null and repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'"); s.find("from foo in class Bar where foo.foo.integer is not null or repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'"); + } + if (dialect instanceof SybaseDialect) { + s.iterate("select baz from Baz as baz join baz.fooArray foo group by baz order by sum(foo.float)"); } |
From: <one...@us...> - 2003-04-21 06:28:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca In directory sc8-pr-cvs1:/tmp/cvs-serv6798/hibernate/jca Modified Files: JCASessionImpl.java Log Message: * renamed remove() to evict() * added lots of JavaDoc to SessionImpl * factored infoString() methods out of SessionImpl Index: JCASessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JCASessionImpl.java 19 Apr 2003 03:26:07 -0000 1.6 --- JCASessionImpl.java 21 Apr 2003 06:28:18 -0000 1.7 *************** *** 257,262 **** } ! public void remove(Object object) throws HibernateException { ! session.remove(object); } --- 257,262 ---- } ! public void evict(Object object) throws HibernateException { ! session.evict(object); } |
From: <one...@us...> - 2003-04-21 06:28:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv6798/hibernate/impl Modified Files: FilterImpl.java SessionImpl.java Added Files: MessageHelper.java Log Message: * renamed remove() to evict() * added lots of JavaDoc to SessionImpl * factored infoString() methods out of SessionImpl --- NEW FILE: MessageHelper.java --- //$Id: MessageHelper.java,v 1.1 2003/04/21 06:28:18 oneovthafew Exp $ package net.sf.hibernate.impl; import java.io.Serializable; import net.sf.hibernate.collection.CollectionPersister; import net.sf.hibernate.persister.ClassPersister; /** * helper methods for rendering log messages and exception * messages */ public final class MessageHelper { public static String infoString(Class clazz, Serializable id) { StringBuffer s = new StringBuffer(); s.append('['); if(clazz==null) { s.append("<null Class>"); } else { s.append( clazz.getName() ); } s.append('#'); if (id==null) { s.append("<null>"); } else { s.append(id); } s.append(']'); return s.toString(); } /** * Generate small message that can be used in traces and exception * messages. * @param persister The persister for the class in question * @param id The id * @return String on the form [FooBar#id] */ public static String infoString(ClassPersister persister, Serializable id) { StringBuffer s = new StringBuffer(); s.append('['); if(persister==null) { s.append("<null ClassPersister>"); } else { s.append(persister.getClassName()); } s.append('#'); if (id==null) { s.append("<null>"); } else { s.append(id); } s.append(']'); return s.toString(); } public static String infoString(ClassPersister persister) { StringBuffer s = new StringBuffer(); s.append('['); if (persister == null) { s.append("<null ClassPersister>"); } else { s.append( persister.getClassName() ); } s.append(']'); return s.toString(); } public static String infoString(CollectionPersister persister, Serializable id) { StringBuffer s = new StringBuffer(); s.append('['); if(persister==null) { s.append("<unreferenced>"); } else { s.append( persister.getRole() ); s.append('#'); if (id==null) { s.append("<null>"); } else { s.append(id); } } s.append(']'); return s.toString(); } } Index: FilterImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/FilterImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FilterImpl.java 8 Apr 2003 09:49:29 -0000 1.6 --- FilterImpl.java 21 Apr 2003 06:28:18 -0000 1.7 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.impl; Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** SessionImpl.java 19 Apr 2003 03:26:07 -0000 1.36 --- SessionImpl.java 21 Apr 2003 06:28:18 -0000 1.37 *************** *** 144,148 **** private transient Batcher batcher; ! static final class Status implements Serializable { private String name; --- 144,154 ---- private transient Batcher batcher; ! ! /** [...1064 lines suppressed...] actype.getPropertyValues( values[i], this ), actype.getSubtypes() --- 3071,3075 ---- else if ( types[i].isComponentType() ) { AbstractComponentType actype = (AbstractComponentType) types[i]; ! evictCollections( actype.getPropertyValues( values[i], this ), actype.getSubtypes() *************** *** 3058,3066 **** } - - - - - - - --- 3080,3081 ---- |
From: <one...@us...> - 2003-04-21 06:28:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv6798/hibernate Modified Files: Session.java Log Message: * renamed remove() to evict() * added lots of JavaDoc to SessionImpl * factored infoString() methods out of SessionImpl Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Session.java 19 Apr 2003 03:26:06 -0000 1.15 --- Session.java 21 Apr 2003 06:28:17 -0000 1.16 *************** *** 181,185 **** * @param object a persistent instance */ ! public void remove(Object object) throws HibernateException; /** --- 181,185 ---- * @param object a persistent instance */ ! public void evict(Object object) throws HibernateException; /** |
From: <one...@us...> - 2003-04-21 06:23:46
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv4135/reference/src Modified Files: query_language.xml Log Message: more query examples Index: query_language.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/query_language.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** query_language.xml 11 Apr 2003 07:12:21 -0000 1.10 --- query_language.xml 21 Apr 2003 06:23:42 -0000 1.11 *************** *** 613,620 **** group by foo.id]]></programlisting> ! <para>Note: You may use the <literal>elements</literal> and <literal>indices</literal> constructs ! inside a select clause, even on databases with no subselects.</para> ! <para>A <literal>having</literal> clause is also allowed.</para> <programlisting><![CDATA[select cat.color, sum(cat.weight), count(cat) --- 613,624 ---- group by foo.id]]></programlisting> ! <para> ! Note: You may use the <literal>elements</literal> and <literal>indices</literal> constructs ! inside a select clause, even on databases with no subselects. ! </para> ! <para> ! A <literal>having</literal> clause is also allowed. ! </para> <programlisting><![CDATA[select cat.color, sum(cat.weight), count(cat) *************** *** 622,626 **** group by cat.color having cat.color in (eg.Color.TABBY, eg.Color.BLACK)]]></programlisting> ! </sect1> --- 626,648 ---- group by cat.color having cat.color in (eg.Color.TABBY, eg.Color.BLACK)]]></programlisting> ! ! <para> ! SQL functions and aggregate functions are allowed in the <literal>having</literal> ! and <literal>order by</literal> clauses, if supported by the underlying database (ie. ! not in MySQL). ! </para> ! ! <programlisting><![CDATA[select cat ! from eg.Cat cat ! join cat.kittens kitten ! group by cat ! having avg(kitten.weight) > 100 ! order by count(kitten) asc, sum(kitten.weight) desc]]></programlisting> ! ! <para> ! Note that neither the <literal>group by</literal> clause nor the ! <literal>order by</literal> clause may contain arithmetic expressions. ! </para> ! </sect1> *************** *** 655,666 **** Hibernate queries can be quite powerful and complex. In fact, the power of the query language is one of Hibernate's main selling points. Here are some example queries very similar to queries ! that I used on a recent project. </para> ! <para> ! This query counts the number of payments in each status, excluding all payments in the <literal>AWAITING_APPROVAL</literal> status where the most recent status change was made by the ! current user. It translates to an SQL query with two inner joins and a subselect against the ! <literal>PAYMENT</literal>, <literal>PAYMENT_STATUS</literal> and <literal>PAYMENT_STATUS_CHANGE</literal> tables. </para> --- 677,735 ---- Hibernate queries can be quite powerful and complex. In fact, the power of the query language is one of Hibernate's main selling points. Here are some example queries very similar to queries ! that I used on a recent project. Note that most queries you will write are much simpler than these! </para> ! <para> ! The following query returns the order id, number of items and total value of the order for all ! unpaid orders for a particular customer and given minimum total value, ordering the results by ! total value. In determining the prices, it uses the current catalog. The resulting SQL query, ! against the <literal>ORDER</literal>, <literal>ORDER_LINE</literal>, <literal>PRODUCT</literal>, ! <literal>CATALOG</literal> and <literal>PRICE</literal> tables has four inner joins and an ! (uncorrelated) subselect. ! </para> ! ! <programlisting><![CDATA[select order.id, sum(price.amount), count(item) ! from Order as order ! join order.lineItems as item ! join item.product as product, ! Catalog as catalog ! join catalog.prices as price ! where order.paid = false ! and order.customer = :customer ! and price.product = product ! and catalog.effectiveDate < sysdate ! and catalog.effectiveDate >= all ( ! select cat.effectiveDate ! from Catalog as cat ! where cat.effectiveDate < sysdate ! ) ! group by order ! having sum(price.amount) > :minAmount ! order by sum(price.amount) desc]]></programlisting> ! ! <para> ! What a monster! Actually, in real life, I'm not very keen on subqueries, so my query was ! really more like this: ! </para> ! ! <programlisting><![CDATA[select order.id, sum(price.amount), count(item) ! from Order as order ! join order.lineItems as item ! join item.product as product, ! Catalog as catalog ! join catalog.prices as price ! where order.paid = false ! and order.customer = :customer ! and price.product = product ! and catalog = :currentCatalog ! group by order ! having sum(price.amount) > :minAmount ! order by sum(price.amount) desc]]></programlisting> ! ! <para> ! The next query counts the number of payments in each status, excluding all payments in the <literal>AWAITING_APPROVAL</literal> status where the most recent status change was made by the ! current user. It translates to an SQL query with two inner joins and a correlated subselect ! against the <literal>PAYMENT</literal>, <literal>PAYMENT_STATUS</literal> and <literal>PAYMENT_STATUS_CHANGE</literal> tables. </para> *************** *** 712,716 **** <para> ! For some databases, we would need to do away with the subselect. </para> --- 781,785 ---- <para> ! For some databases, we would need to do away with the (correlated) subselect. </para> |
From: <max...@us...> - 2003-04-20 11:52:50
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv18917/src/net/sf/hibernate/tool/hbm2java Modified Files: Generator.java ClassMapping.java Log Message: small stuff. * some info logs changed to debug to make hbm2java less verbose. Index: Generator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/Generator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Generator.java 5 Apr 2003 16:18:02 -0000 1.9 --- Generator.java 20 Apr 2003 11:52:47 -0000 1.10 *************** *** 107,111 **** File dir = this.getDir(classMapping.getGeneratedPackageName()); File file = new File(dir, this.getFileName(classMapping.getGeneratedName())); ! log.info("Writing " + file); PrintWriter writer = new PrintWriter(new FileOutputStream(file)); --- 107,111 ---- File dir = this.getDir(classMapping.getGeneratedPackageName()); File file = new File(dir, this.getFileName(classMapping.getGeneratedName())); ! log.debug("Writing " + file); PrintWriter writer = new PrintWriter(new FileOutputStream(file)); Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ClassMapping.java 12 Apr 2003 14:47:36 -0000 1.14 --- ClassMapping.java 20 Apr 2003 11:52:47 -0000 1.15 *************** *** 81,85 **** String fullyQualifiedName = classElement.getAttributeValue(component?"class":"name"); ! log.info("Processing mapping for class: " + fullyQualifiedName); setMetaAttribs(MetaAttributeHelper.loadAndMergeMetaMap(classElement, inheritedMeta)); --- 81,85 ---- String fullyQualifiedName = classElement.getAttributeValue(component?"class":"name"); ! log.debug("Processing mapping for class: " + fullyQualifiedName); setMetaAttribs(MetaAttributeHelper.loadAndMergeMetaMap(classElement, inheritedMeta)); |
From: <max...@us...> - 2003-04-20 11:52:50
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test In directory sc8-pr-cvs1:/tmp/cvs-serv18917/src/net/sf/hibernate/tool/hbm2java/test Modified Files: config.xml Log Message: small stuff. * some info logs changed to debug to make hbm2java less verbose. Index: config.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test/config.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config.xml 16 Jan 2003 20:52:38 -0000 1.3 --- config.xml 20 Apr 2003 11:52:47 -0000 1.4 *************** *** 9,13 **** --> <codegen> ! <meta attribute="implements">codegen.test.IAuditable</meta> <generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/> </codegen> --- 9,14 ---- --> <codegen> ! <!-- <meta attribute="implements">codegen.test.IAuditable</meta>--> <generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/> + <generate package="autofinders.only" suffix="Finder" renderer="net.sf.hibernate.tool.hbm2java.FinderRenderer"/> </codegen> |
From: <one...@us...> - 2003-04-19 03:34:38
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv27811/reference/src Modified Files: advanced_or_mapping.xml basic_or_mapping.xml Log Message: documented collection where attribute improved explanation of new import approach Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** advanced_or_mapping.xml 15 Apr 2003 09:28:51 -0000 1.16 --- advanced_or_mapping.xml 19 Apr 2003 03:34:34 -0000 1.17 *************** *** 125,128 **** --- 125,129 ---- <area id="mappingcollection7" coords="8 50"/> <area id="mappingcollection8" coords="9 50"/> + <area id="mappingcollection9" coords="10 50"/> </areaspec> <programlisting><![CDATA[<map *************** *** 134,138 **** cascade="all|none|save-update|delete" sort="unsorted|natural|comparatorClass" ! order-by="column_name asc|desc"> <key .... /> --- 135,140 ---- cascade="all|none|save-update|delete" sort="unsorted|natural|comparatorClass" ! order-by="column_name asc|desc" ! where="arbitrary sql where condition"> <key .... /> *************** *** 186,190 **** <literal>order-by</literal> (optional, JDK1.4 only) specify a table column (or columns) that define the iteration order of the <literal>Map</literal>, <literal>Set</literal> ! or bag, together with an optional <literal>asc</literal> or <literal>desc</literal>. </para> </callout> --- 188,199 ---- <literal>order-by</literal> (optional, JDK1.4 only) specify a table column (or columns) that define the iteration order of the <literal>Map</literal>, <literal>Set</literal> ! or bag, together with an optional <literal>asc</literal> or <literal>desc</literal> ! </para> ! </callout> ! <callout arearefs="mappingcollection9"> ! <para> ! <literal>where</literal> (optional) specify an arbitrary SQL <literal>WHERE</literal> ! condition to be used when retrieving or removing the collection (useful if the ! collection should contain only a subset of the available data) </para> </callout> Index: basic_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/basic_or_mapping.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** basic_or_mapping.xml 11 Apr 2003 07:12:21 -0000 1.14 --- basic_or_mapping.xml 19 Apr 2003 03:34:34 -0000 1.15 *************** *** 112,116 **** </calloutlist> </programlistingco> ! </sect2> --- 112,121 ---- </calloutlist> </programlistingco> ! ! <para> ! If you have two persistent classes with the same (unqualified) name, you should set ! <literal>auto-import="false"</literal>. Hibernate will throw an exception if you attempt ! to assign two classes to the same "imported" name. ! </para> </sect2> *************** *** 599,606 **** --- 604,613 ---- <area id="discriminator1" coords="2 40"/> <area id="discriminator2" coords="3 40" /> + <area id="discriminator3" coords="4 40" /> </areaspec> <programlisting><![CDATA[<discriminator column="discriminator_column" type="discriminator_type" + force="true|false" />]]></programlisting> <calloutlist> *************** *** 617,620 **** --- 624,634 ---- </para> </callout> + <callout arearefs="discriminator3"> + <para> + <literal>force</literal> (optional - defaults to <literal>false</literal>) + "force" Hibernate to specify allowed discriminator values even when retrieving + all instances of the root class. + </para> + </callout> </calloutlist> </programlistingco> *************** *** 625,628 **** --- 639,648 ---- <literal><subclass></literal> elements. </para> + + <para> + The <literal>force</literal> attribute is (only) useful if the table contains rows with + "extra" discriminator values that are not mapped to a persistent class. This will not + usually be the case. + </para> </sect2> *************** *** 1206,1211 **** Suppose your application has two persistent classes with the same name, and you don't want to specify the fully qualified (package) name in Hibernate queries. Classes may be "imported" ! explicitly, rather than relying upon <literal>auto-import="true"</literal>. You may even import classes ! and interfaces that are not explicitly mapped. </para> --- 1226,1231 ---- Suppose your application has two persistent classes with the same name, and you don't want to specify the fully qualified (package) name in Hibernate queries. Classes may be "imported" ! explicitly, rather than relying upon <literal>auto-import="true"</literal>. You may even import ! classes and interfaces that are not explicitly mapped. </para> |
From: <one...@us...> - 2003-04-19 03:26:43
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/loader Modified Files: Loader.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Loader.java 8 Apr 2003 09:49:30 -0000 1.17 --- Loader.java 19 Apr 2003 03:26:08 -0000 1.18 *************** *** 126,130 **** final boolean[] hydrate = new boolean[cols]; //we can reuse it each time ! for ( int count=0; count<maxRows && rs.next(); count++ ) { for ( int i=0; i<cols; i++ ) { --- 126,133 ---- final boolean[] hydrate = new boolean[cols]; //we can reuse it each time ! if ( log.isTraceEnabled() ) log.trace("processing result set"); ! ! int count; ! for ( count=0; count<maxRows && rs.next(); count++ ) { for ( int i=0; i<cols; i++ ) { *************** *** 156,160 **** } - results.add( getResultColumnOrRow(row, rs, session) ); --- 159,162 ---- *************** *** 162,165 **** --- 164,169 ---- } + if ( log.isTraceEnabled() ) log.trace("done processing result set (" + count + " rows)"); + } catch (SQLException sqle) { *************** *** 374,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 && --- 378,391 ---- * 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 && |
From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/engine Modified Files: Cascades.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cascades.java 8 Apr 2003 09:49:27 -0000 1.10 --- Cascades.java 19 Apr 2003 03:26:07 -0000 1.11 *************** *** 13,18 **** import net.sf.hibernate.collection.PersistentCollection; import net.sf.hibernate.persister.ClassPersister; - import net.sf.hibernate.proxy.HibernateProxy; - import net.sf.hibernate.proxy.HibernateProxyHelper; import net.sf.hibernate.type.AbstractComponentType; import net.sf.hibernate.type.AssociationType; --- 13,16 ---- *************** *** 21,25 **** /** ! * Implements cascaded save / delete / update * @see net.sf.hibernate.type.AssociationType */ --- 19,23 ---- /** ! * Implements cascaded save / delete / update / remove * @see net.sf.hibernate.type.AssociationType */ *************** *** 59,81 **** /** * @see net.sf.hibernate.Session#saveOrUpdate(Object) */ public static final CascadingAction ACTION_SAVE_UPDATE = new CascadingAction() { void cascade(Session session, Object child) throws HibernateException { ! if ( ! !(child instanceof HibernateProxy) || ! !HibernateProxyHelper.getLazyInitializer( (HibernateProxy) child ).isUninitialized() ! // saves / updates don't cascade to uninitialized proxies ! ) { ! log.trace("cascading to saveOrUpdate()"); ! session.saveOrUpdate(child); ! } } boolean shouldCascadeCollection(Object collection) { ! return !(collection instanceof PersistentCollection) || ( (PersistentCollection) collection ).wasInitialized(); // saves / updates don't cascade to uninitialized collections } }; // The types of children to cascade to: --- 57,90 ---- /** + * @see net.sf.hibernate.Session#remove(Object) + */ + public static final CascadingAction ACTION_REMOVE = new CascadingAction() { + void cascade(Session session, Object child) throws HibernateException { + log.trace("cascading to remove()"); + session.remove(child); + } + boolean shouldCascadeCollection(Object collection) { + return collectionIsInitialized(collection); + } + }; + + /** * @see net.sf.hibernate.Session#saveOrUpdate(Object) */ public static final CascadingAction ACTION_SAVE_UPDATE = new CascadingAction() { void cascade(Session session, Object child) throws HibernateException { ! log.trace("cascading to saveOrUpdate()"); ! session.saveOrUpdate(child); } boolean shouldCascadeCollection(Object collection) { ! return collectionIsInitialized(collection); // saves / updates don't cascade to uninitialized collections } }; + private static boolean collectionIsInitialized(Object collection) { + return !(collection instanceof PersistentCollection) || ( (PersistentCollection) collection ).wasInitialized(); + } + // The types of children to cascade to: *************** *** 96,102 **** public static final int CASCADE_AFTER_INSERT_BEFORE_DELETE_VIA_COLLECTION = 3; /** ! * A cascade point that occurs just after the update of the parent entity */ public static final int CASCADE_ON_UPDATE = 0; // The allowable cascade styles for a property: --- 105,116 ---- public static final int CASCADE_AFTER_INSERT_BEFORE_DELETE_VIA_COLLECTION = 3; /** ! * A cascade point that occurs just after update of the parent entity */ public static final int CASCADE_ON_UPDATE = 0; + /** + * A cascade point that occurs just after removal of the parent entity from the + * session cache + */ + public static final int CASCADE_ON_REMOVE = 0; // The allowable cascade styles for a property: *************** *** 114,118 **** }; /** ! * save / delete / update */ public static final CascadeStyle STYLE_ALL = new CascadeStyle() { --- 128,132 ---- }; /** ! * save / delete / update / remove */ public static final CascadeStyle STYLE_ALL = new CascadeStyle() { *************** *** 124,130 **** * save / update */ ! public static final CascadeStyle STYLE_EXCEPT_DELETE = new CascadeStyle() { boolean doCascade(CascadingAction action) { ! return action!=ACTION_DELETE; } }; --- 138,144 ---- * save / update */ ! public static final CascadeStyle STYLE_SAVE_UPDATE = new CascadeStyle() { boolean doCascade(CascadingAction action) { ! return action==ACTION_SAVE_UPDATE; } }; *************** *** 207,211 **** * Cascade an action to the child */ ! private static void cascade(SessionImplementor session, Object child, Type type, CascadingAction action, int cascadeTo) throws HibernateException { if (child!=null) { if ( type.isAssociationType() ) { --- 221,231 ---- * Cascade an action to the child */ ! private static void cascade( ! SessionImplementor session, ! Object child, ! Type type, ! CascadingAction action, ! int cascadeTo) throws HibernateException { ! if (child!=null) { if ( type.isAssociationType() ) { *************** *** 267,271 **** * Cascade an action from the parent object to all its children */ ! public static void cascade(SessionImplementor session, ClassPersister persister, Object parent, Cascades.CascadingAction action, int cascadeTo) throws HibernateException { if ( persister.hasCascades() ) { // performance opt if ( log.isTraceEnabled() ) log.trace( "processing cascades for: " + persister.getClassName() ); --- 287,297 ---- * Cascade an action from the parent object to all its children */ ! public static void cascade( ! SessionImplementor session, ! ClassPersister persister, ! Object parent, ! Cascades.CascadingAction action, ! int cascadeTo) throws HibernateException { ! if ( persister.hasCascades() ) { // performance opt if ( log.isTraceEnabled() ) log.trace( "processing cascades for: " + persister.getClassName() ); |
From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/jmx Modified Files: HibernateService.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: HibernateService.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx/HibernateService.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HibernateService.java 8 Apr 2003 14:26:41 -0000 1.7 --- HibernateService.java 19 Apr 2003 03:26:07 -0000 1.8 *************** *** 142,146 **** InitialContext context = NamingHelper.getInitialContext( getProperties() ); ( (SessionFactory) context.lookup(boundName) ).close(); ! context.unbind(boundName); } catch (Exception e) { --- 142,146 ---- InitialContext context = NamingHelper.getInitialContext( getProperties() ); ( (SessionFactory) context.lookup(boundName) ).close(); ! //context.unbind(boundName); } catch (Exception e) { |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/impl Modified Files: IteratorImpl.java ScheduledCollectionUpdate.java SessionFactoryImpl.java SessionFactoryObjectFactory.java SessionImpl.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/IteratorImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IteratorImpl.java 5 Jan 2003 02:11:21 -0000 1.3 --- IteratorImpl.java 19 Apr 2003 03:26:07 -0000 1.4 *************** *** 44,51 **** --- 44,53 ---- this.hasNext = hasNext; if (!hasNext) { + log.debug("exhausted results"); nextResults = null; rs.close(); } else { + log.debug("retrieving next results"); nextResults = new Object[types.length]; for (int i=0; i<types.length; i++) { *************** *** 64,67 **** --- 66,70 ---- currentResults = nextResults; postNext( rs.next() ); + log.debug("returning current results"); if (single) { return currentResults[0]; Index: ScheduledCollectionUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionUpdate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScheduledCollectionUpdate.java 2 Apr 2003 01:06:51 -0000 1.6 --- ScheduledCollectionUpdate.java 19 Apr 2003 03:26:07 -0000 1.7 *************** *** 14,21 **** private final PersistentCollection collection; ! public ScheduledCollectionUpdate(PersistentCollection collection, CollectionPersister persister, Serializable id, SessionImplementor session) { super(persister, id, session); this.collection = collection; } --- 14,28 ---- private final PersistentCollection collection; + private final boolean emptySnapshot; ! public ScheduledCollectionUpdate( ! PersistentCollection collection, ! CollectionPersister persister, ! Serializable id, ! boolean emptySnapshot, ! SessionImplementor session) { super(persister, id, session); this.collection = collection; + this.emptySnapshot = emptySnapshot; } *************** *** 27,34 **** } else if ( collection.empty() ) { ! persister.remove(id, session); } ! else if ( collection.needsRecreate( persister.getElementType() ) ) { ! persister.remove(id, session); persister.recreate(collection, id, session); } --- 34,41 ---- } else if ( collection.empty() ) { ! if (!emptySnapshot) persister.remove(id, session); } ! else if ( collection.needsRecreate() ) { ! if (!emptySnapshot) persister.remove(id, session); persister.recreate(collection, id, session); } Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SessionFactoryImpl.java 10 Apr 2003 09:49:16 -0000 1.18 --- SessionFactoryImpl.java 19 Apr 2003 03:26:07 -0000 1.19 *************** *** 120,123 **** --- 120,125 ---- public SessionFactoryImpl(Configuration cfg, Properties properties, Interceptor interceptor) throws HibernateException { + log.info("building session factory"); + if ( log.isDebugEnabled() ) log.debug("instantiating session factory with properties: " + properties); *************** *** 283,288 **** imports = new HashMap( cfg.getImports() ); ! ! log.debug("Instantiated session factory"); } --- 285,289 ---- imports = new HashMap( cfg.getImports() ); ! log.debug("instantiated session factory"); } *************** *** 703,708 **** public void close() throws HibernateException { if (statementCache!=null) statementCache.close(); ! connections.close(); } --- 704,717 ---- public void close() throws HibernateException { + + log.info("closing"); + if (statementCache!=null) statementCache.close(); ! try { ! connections.close(); ! } ! finally { ! SessionFactoryObjectFactory.removeInstance(uuid, name, properties); ! } } Index: SessionFactoryObjectFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryObjectFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionFactoryObjectFactory.java 5 Jan 2003 02:11:21 -0000 1.3 --- SessionFactoryObjectFactory.java 19 Apr 2003 03:26:07 -0000 1.4 *************** *** 106,109 **** --- 106,135 ---- } + public static void removeInstance(String uid, String name, Properties properties) { + //TODO: theoretically non-threadsafe... + + if (name!=null) { + log.info("Unbinding factory: " + name); + + try { + Context ctx = NamingHelper.getInitialContext(properties); + ctx.unbind(name); + log.info("Unbound factory from JNDI name: " + name); + } + catch (InvalidNameException ine) { + log.error("Invalid JNDI name: " + name, ine); + } + catch (NamingException ne) { + log.warn("Could not unbind factory from JNDI", ne); + } + + namedInstances.remove(name); + + } + + instances.remove(uid); + + } + public static Object getNamedInstance(String name) { log.debug("lookup: name=" + name); *************** *** 125,140 **** return result; } ! ! /** ! * Theoretically nonthreadsafe, but its only called by ! * applications using <tt>Hibernate.configure()</tt> which ! * is synchronized, so it shouldn't be a problem in ! * practice. ! */ ! public static void clear() { ! instances.clear(); ! namedInstances.clear(); ! } ! } --- 151,155 ---- return result; } ! } Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** SessionImpl.java 16 Apr 2003 04:54:32 -0000 1.35 --- SessionImpl.java 19 Apr 2003 03:26:07 -0000 1.36 *************** *** 648,652 **** } ! if ( log.isTraceEnabled() ) log.trace( "saving " + infoString(persister,id) ); if (!identityCol) { // if the id is generated by the database, we assign the key later --- 648,652 ---- } ! if ( log.isTraceEnabled() ) log.trace( "saving " + infoString(persister, id) ); if (!identityCol) { // if the id is generated by the database, we assign the key later *************** *** 1035,1038 **** --- 1035,1039 ---- private void removeCollection(CollectionPersister role, Serializable id) { + if ( log.isTraceEnabled() ) log.trace( "collection dereferenced while transient " + infoString(role, id) ); collectionRemovals.add( new ScheduledCollectionRemove(role, id, false, this) ); } *************** *** 1045,1051 **** PersistentCollection coll = (PersistentCollection) value; if ( coll.wasInitialized() ) { ! CollectionSnapshot cs = coll.getCollectionSnapshot(); ! if (cs!=null && cs.getRole().equals( persister.getRole() ) && cs.getKey().equals(id) ) { ! if ( coll.setSession(this) ) addInitializedCollection(coll, cs); } else { --- 1046,1056 ---- PersistentCollection coll = (PersistentCollection) value; if ( coll.wasInitialized() ) { ! CollectionSnapshot snapshot = coll.getCollectionSnapshot(); ! if ( ! snapshot!=null && ! snapshot.getRole().equals( persister.getRole() ) && ! snapshot.getKey().equals(id) ! ) { ! if ( coll.setSession(this) ) addInitializedCollection(coll, snapshot); } else { *************** *** 1790,1793 **** --- 1795,1799 ---- } lock(old, lockMode); + if ( log.isTraceEnabled() ) log.trace( "resolved object in session cache " + infoString(persister, id) ); return old; } *************** *** 1798,1806 **** CacheEntry entry = persister.hasCache() ? (CacheEntry) persister.getCache().get(id, timestamp) : null; if (entry!=null) { ClassPersister subclassPersister = getPersister( entry.getSubclass() ); Object result = (isOptionalObject) ? optionalObject : instantiate(subclassPersister, id); 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); --- 1804,1813 ---- CacheEntry entry = persister.hasCache() ? (CacheEntry) persister.getCache().get(id, timestamp) : null; if (entry!=null) { + if ( log.isTraceEnabled() ) log.trace( "resolved object in JCS cache " + infoString(persister, id) ); ClassPersister subclassPersister = getPersister( entry.getSubclass() ); Object result = (isOptionalObject) ? optionalObject : instantiate(subclassPersister, id); 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 result by side-effect Type[] types = subclassPersister.getPropertyTypes(); TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); *************** *** 1817,1821 **** else { //otherwise go ahead and load it! ! // Note: you can't use "for update" with an outer join try { return persister.load(id, optionalObject, lockMode, this); --- 1824,1828 ---- else { //otherwise go ahead and load it! ! if ( log.isTraceEnabled() ) log.trace( "object not resolved in any cache " + infoString(persister, id) ); try { return persister.load(id, optionalObject, lockMode, this); *************** *** 1846,1849 **** --- 1853,1858 ---- EntityEntry e = removeEntry(object); + if ( log.isTraceEnabled() ) log.trace( "refreshing " + infoString(e.persister, e.id) ); + if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); *************** *** 1867,1871 **** Type[] types = persister.getPropertyTypes(); ! if ( log.isDebugEnabled() ) log.debug( "resolving associations for: " + infoString(persister, id) ); interceptor.onLoad( object, id, hydratedState, persister.getPropertyNames(), types ); --- 1876,1880 ---- Type[] types = persister.getPropertyTypes(); ! if ( log.isDebugEnabled() ) log.debug( "resolving associations for " + infoString(persister, id) ); interceptor.onLoad( object, id, hydratedState, persister.getPropertyNames(), types ); *************** *** 1877,1882 **** TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyUpdateability(), hydratedState); //after setting values to object ! if ( persister.hasCache() ) ! persister.getCache().put( id, new CacheEntry(object, persister, this), timestamp ); reentrantCallback=true; --- 1886,1893 ---- TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyUpdateability(), hydratedState); //after setting values to object ! if ( persister.hasCache() ) { ! if ( log.isDebugEnabled() ) log.debug( "adding entity to JCS cache " + infoString(persister, id) ); ! persister.getCache().put( id, new CacheEntry(object, persister, this), timestamp ); ! } reentrantCallback=true; *************** *** 1886,1889 **** --- 1897,1902 ---- reentrantCallback=false; + if ( log.isDebugEnabled() ) log.debug( "done materializing entity " + infoString(persister, id) ); + } *************** *** 1967,1971 **** private void execute() throws HibernateException { ! log.trace("Executing"); try { --- 1980,1984 ---- private void execute() throws HibernateException { ! log.trace("executing flush"); try { *************** *** 2273,2277 **** if ( ce.dorecreate ) collectionCreations.add( new ScheduledCollectionRecreate(coll, ce.currentPersister, ce.currentKey, this) ); if ( ce.doremove ) collectionRemovals.add( new ScheduledCollectionRemove(ce.loadedPersister, ce.loadedKey, ce.snapshotIsEmpty(), this) ); ! if ( ce.doupdate ) collectionUpdates.add( new ScheduledCollectionUpdate(coll, ce.loadedPersister, ce.loadedKey, this) ); } --- 2286,2290 ---- if ( ce.dorecreate ) collectionCreations.add( new ScheduledCollectionRecreate(coll, ce.currentPersister, ce.currentKey, this) ); if ( ce.doremove ) collectionRemovals.add( new ScheduledCollectionRemove(ce.loadedPersister, ce.loadedKey, ce.snapshotIsEmpty(), this) ); ! if ( ce.doupdate ) collectionUpdates.add( new ScheduledCollectionUpdate(coll, ce.loadedPersister, ce.loadedKey, ce.snapshotIsEmpty(), this) ); } *************** *** 2983,2986 **** --- 2996,3057 ---- else { return entries.containsKey(object); + } + } + + public void remove(Object object) throws HibernateException { + if (object instanceof HibernateProxy) { + LazyInitializer li = HibernateProxyHelper.getLazyInitializer( (HibernateProxy) object ); + Serializable id = li.getIdentifier(); + ClassPersister persister = getPersister( li.getPersistentClass() ); + Key key = new Key(id, persister); + proxiesByKey.remove(key); + if ( !li.isUninitialized() ) { + Object entity = removeEntity(key); + if (entity!=null) { + removeEntry(entity); + doRemove(persister, entity); + } + } + } + else { + EntityEntry e = (EntityEntry) removeEntry(object); + if (e!=null) { + removeEntity( new Key(e.id, e.persister) ); + doRemove(e.persister, object); + } + } + } + + private void doRemove(ClassPersister persister, Object object) throws HibernateException { + + if ( log.isTraceEnabled() ) log.trace( "removing from session cache " + infoString(persister) ); + + //remove all collections for the entity + disassociateCollections( persister.getPropertyValues(object), persister.getPropertyTypes() ); + Cascades.cascade(this, persister, object, Cascades.ACTION_REMOVE, Cascades.CASCADE_ON_REMOVE); + } + + private void disassociateCollections(Object[] values, Type[] types) throws HibernateException { + for ( int i=0; i<types.length; i++ ) { + if ( types[i].isPersistentCollectionType() ) { + Object pc=null; + if ( ( (PersistentCollectionType) types[i] ).isArrayType() ) { + pc = arrayHolders.remove( values[i] ); + } + else if ( values[i] instanceof PersistentCollection ) { + pc = values[i]; + } + + if (pc!=null) { + if ( ( (PersistentCollection) pc ).unsetSession(this) ) collections.remove(pc); + } + } + else if ( types[i].isComponentType() ) { + AbstractComponentType actype = (AbstractComponentType) types[i]; + disassociateCollections( + actype.getPropertyValues( values[i], this ), + actype.getSubtypes() + ); + } } } |
From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/jca Modified Files: JCASessionImpl.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: JCASessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JCASessionImpl.java 29 Mar 2003 04:08:47 -0000 1.5 --- JCASessionImpl.java 19 Apr 2003 03:26:07 -0000 1.6 *************** *** 257,259 **** --- 257,263 ---- } + public void remove(Object object) throws HibernateException { + session.remove(object); + } + } |
From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/collection Modified Files: Bag.java CollectionPersister.java PersistentCollection.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Bag.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Bag.java 6 Apr 2003 10:11:07 -0000 1.10 --- Bag.java 19 Apr 2003 03:26:07 -0000 1.11 *************** *** 171,175 **** } ! public boolean needsRecreate(Type elemType) throws HibernateException { return true; } --- 171,175 ---- } ! public boolean needsRecreate() throws HibernateException { return true; } Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CollectionPersister.java 18 Apr 2003 05:09:49 -0000 1.19 --- CollectionPersister.java 19 Apr 2003 03:26:07 -0000 1.20 *************** *** 206,210 **** } - public CollectionInitializer getInitializer() { return loader; --- 206,209 ---- *************** *** 219,222 **** --- 218,222 ---- public void cache(Serializable id, PersistentCollection coll, SessionImplementor s) throws HibernateException { if (cache!=null) { + if ( log.isDebugEnabled() ) log.debug("Caching collection: " + role + '#' + id); cache.put( id, coll.disassemble(this), s.getTimestamp() ); } *************** *** 228,231 **** --- 228,232 ---- } else { + if ( log.isDebugEnabled() ) log.debug("Searching for collection in cache: " + role + '#' + id); Serializable cached = (Serializable) cache.get( id, s.getTimestamp() ); if (cached==null) { *************** *** 514,517 **** --- 515,520 ---- } + if ( log.isDebugEnabled() ) log.debug("done deleting collection"); + } *************** *** 547,550 **** --- 550,558 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done inserting collection"); + } + else { + if ( log.isDebugEnabled() ) log.debug("collection was empty"); } } *************** *** 575,578 **** --- 583,591 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done deleting collection rows"); + } + else { + if ( log.isDebugEnabled() ) log.debug("no rows to delete"); } } *************** *** 659,662 **** --- 672,677 ---- update(id, collection, session); } + + if ( log.isDebugEnabled() ) log.debug("done updating rows"); } } *************** *** 689,692 **** --- 704,709 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done inserting rows"); } } Index: PersistentCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/PersistentCollection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PersistentCollection.java 6 Apr 2003 10:11:07 -0000 1.12 --- PersistentCollection.java 19 Apr 2003 03:26:07 -0000 1.13 *************** *** 159,162 **** --- 159,172 ---- } + public final boolean unsetSession(SessionImplementor session) { + if (session==this.session) { + this.session=null; + return true; + } + else { + return false; + } + } + public final boolean setSession(SessionImplementor session) throws HibernateException { if (session==this.session) { *************** *** 190,194 **** public abstract Serializable disassemble(CollectionPersister persister) throws HibernateException; ! public boolean needsRecreate(Type elemType) throws HibernateException { return false; } --- 200,204 ---- public abstract Serializable disassemble(CollectionPersister persister) throws HibernateException; ! public boolean needsRecreate() throws HibernateException { return false; } |
From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate Modified Files: Hibernate.java Session.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Hibernate.java 11 Apr 2003 07:15:50 -0000 1.11 --- Hibernate.java 19 Apr 2003 03:26:06 -0000 1.12 *************** *** 246,249 **** --- 246,265 ---- /** + * Get the true, underlying class of a proxied persistent class. This operation + * will initialize a proxy by side-effect. + * @param proxy a persistable object or proxy + * @return the true class of the instance + * @throws HibernateException + */ + public Class getClass(Object proxy) throws HibernateException { + if (proxy instanceof HibernateProxy) { + return HibernateProxyHelper.getLazyInitializer( (HibernateProxy) proxy ).getImplementation().getClass(); + } + else { + return proxy.getClass(); + } + } + + /** * Create a new <tt>Blob</tt>. The returned object will be * initially immutable. Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Session.java 29 Mar 2003 04:08:46 -0000 1.14 --- Session.java 19 Apr 2003 03:26:06 -0000 1.15 *************** *** 175,178 **** --- 175,185 ---- */ public boolean contains(Object object); + /** + * Remove this instance from the session cache. Changes to the instance will + * not be synchronized with the database. + * + * @param object a persistent instance + */ + public void remove(Object object) throws HibernateException; /** |
From: <one...@us...> - 2003-04-19 03:26:17
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/test Modified Files: FooBarTest.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** FooBarTest.java 18 Apr 2003 05:09:51 -0000 1.56 --- FooBarTest.java 19 Apr 2003 03:26:11 -0000 1.57 *************** *** 1079,1082 **** --- 1079,1097 ---- } + public void testRemoveContains() throws Exception { + Session s = sessions.openSession(); + Baz baz = new Baz(); + baz.setDefaults(); + s.save(baz); + s.flush(); + assertTrue( s.contains(baz) ); + s.remove(baz); + assertFalse( s.contains(baz) ); + Baz baz2 = (Baz) s.load( Baz.class, baz.getCode() ); + assertFalse(baz==baz2); + s.delete(baz2); + s.flush(); + } + public void testCollectionOfSelf() throws Exception { Session s = sessions.openSession(); *************** *** 2818,2822 **** s.find("from foo in class net.sf.hibernate.test.Fo"); tx.commit(); ! assertTrue( s.close()!=null); c.close(); } --- 2833,2837 ---- s.find("from foo in class net.sf.hibernate.test.Fo"); tx.commit(); ! assertTrue( s.close()==c ); c.close(); } |