You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2002-11-23 01:16:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv7161/hibernate/query Modified Files: QueryTranslator.java Log Message: more efficient impl of scalars-in-find() ... still hacky, though Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** QueryTranslator.java 22 Nov 2002 07:03:07 -0000 1.46 --- QueryTranslator.java 23 Nov 2002 01:16:21 -0000 1.47 *************** *** 185,188 **** --- 185,192 ---- } + protected boolean hasScalarValues() { + return types.length!=persisters.length; + } + private void logQuery(String hql, String sql) { if ( log.isDebugEnabled() ) { *************** *** 520,527 **** } ! selectPropertiesString = selectPerhapsDistinct + ! buf.append( (size==0) ? "" : ", " ) ! .append(scalarSelectString) ! .toString(); //FROM --- 524,532 ---- } ! selectPropertiesString = selectPerhapsDistinct + buf.toString(); ! if (ttsize!=size) { ! if (size!=0) selectPropertiesString += ", "; ! selectPropertiesString += scalarSelectString; ! } //FROM |
From: <one...@us...> - 2002-11-23 01:16:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv7161/hibernate/loader Modified Files: Loader.java Log Message: more efficient impl of scalars-in-find() ... still hacky, though Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Loader.java 22 Nov 2002 07:03:07 -0000 1.29 --- Loader.java 23 Nov 2002 01:16:20 -0000 1.30 *************** *** 71,78 **** return true; } ! protected Type[] getReturnTypes() { return null; } /** --- 71,86 ---- return true; } ! /** ! * The column types of a find() query ! */ protected Type[] getReturnTypes() { return null; } + /** + * A hack to allow scalar values in a find() query + */ + protected boolean hasScalarValues() { + return false; + } /** *************** *** 116,121 **** String[][] names = null; ! final Type[] returnTypes = getReturnTypes(); ! if ( returnTypes!=null ) { names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() ); } --- 124,131 ---- String[][] names = null; ! Type[] returnTypes = null; ! final boolean scalars = hasScalarValues(); ! if (scalars) { ! returnTypes = getReturnTypes(); names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() ); } *************** *** 161,168 **** } ! if (returnTypes==null) { ! results.add( ( cols==1 ) ? row[0] : row ); - } else { --- 171,177 ---- } ! if (!scalars) { ! //hacky!! results.add( ( cols==1 ) ? row[0] : row ); } else { |
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection In directory sc8-pr-cvs1:/tmp/cvs-serv25339/hibernate/connection Modified Files: C3P0ConnectionProvider.java DBCPConnectionProvider.java DriverManagerConnectionProvider.java Log Message: fix Iterator exception subclass (by Alex Staubo) set connection isolation levels _before_ starting transactions Index: C3P0ConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection/C3P0ConnectionProvider.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** C3P0ConnectionProvider.java 27 Oct 2002 03:11:33 -0000 1.16 --- C3P0ConnectionProvider.java 23 Nov 2002 00:24:17 -0000 1.17 *************** *** 33,38 **** try { final Connection c = ds.getConnection(); - c.setAutoCommit(false); if (isolation!=null) c.setTransactionIsolation( isolation.intValue() ); return c; } --- 33,38 ---- try { final Connection c = ds.getConnection(); if (isolation!=null) c.setTransactionIsolation( isolation.intValue() ); + c.setAutoCommit(false); return c; } Index: DBCPConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection/DBCPConnectionProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DBCPConnectionProvider.java 27 Oct 2002 03:11:33 -0000 1.4 --- DBCPConnectionProvider.java 23 Nov 2002 00:24:17 -0000 1.5 *************** *** 38,43 **** try { final Connection c = ds.getConnection(); - c.setAutoCommit(false); if (isolation!=null) c.setTransactionIsolation( isolation.intValue() ); return c; } --- 38,43 ---- try { final Connection c = ds.getConnection(); if (isolation!=null) c.setTransactionIsolation( isolation.intValue() ); + c.setAutoCommit(false); return c; } Index: DriverManagerConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/connection/DriverManagerConnectionProvider.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DriverManagerConnectionProvider.java 26 Oct 2002 06:35:16 -0000 1.17 --- DriverManagerConnectionProvider.java 23 Nov 2002 00:24:17 -0000 1.18 *************** *** 80,85 **** try { conn = DriverManager.getConnection(url, connectionProps); - conn.setAutoCommit(false); if (isolation!=null) conn.setTransactionIsolation( isolation.intValue() ); } catch (SQLException sqle) { --- 80,85 ---- try { conn = DriverManager.getConnection(url, connectionProps); if (isolation!=null) conn.setTransactionIsolation( isolation.intValue() ); + conn.setAutoCommit(false); } catch (SQLException sqle) { |
From: <one...@us...> - 2002-11-23 00:24:19
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv25339/hibernate/impl Modified Files: IteratorImpl.java Log Message: fix Iterator exception subclass (by Alex Staubo) set connection isolation levels _before_ starting transactions Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/IteratorImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** IteratorImpl.java 22 Nov 2002 07:03:06 -0000 1.9 --- IteratorImpl.java 23 Nov 2002 00:24:16 -0000 1.10 *************** *** 2,7 **** package cirrus.hibernate.impl; ! import java.sql.*; import java.util.Iterator; import org.apache.commons.logging.Log; --- 2,9 ---- package cirrus.hibernate.impl; ! import java.sql.ResultSet; ! import java.sql.SQLException; import java.util.Iterator; + import java.util.NoSuchElementException; import org.apache.commons.logging.Log; *************** *** 10,14 **** import cirrus.hibernate.HibernateException; import cirrus.hibernate.LazyInitializationException; ! import cirrus.hibernate.engine.*; import cirrus.hibernate.query.QueryTranslator; import cirrus.hibernate.type.Type; --- 12,16 ---- import cirrus.hibernate.HibernateException; import cirrus.hibernate.LazyInitializationException; ! import cirrus.hibernate.engine.SessionImplementor; import cirrus.hibernate.query.QueryTranslator; import cirrus.hibernate.type.Type; *************** *** 60,64 **** public Object next() { ! if ( nextResults==null ) throw new IllegalStateException("No more results"); try { currentResults = nextResults; --- 62,66 ---- public Object next() { ! if ( nextResults==null ) throw new NoSuchElementException("No more results"); try { currentResults = nextResults; |
From: <one...@us...> - 2002-11-22 07:03:10
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv5673/hibernate/impl Modified Files: IteratorImpl.java Log Message: experimental support for scalar selects in find() Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/IteratorImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IteratorImpl.java 1 Oct 2002 01:25:29 -0000 1.8 --- IteratorImpl.java 22 Nov 2002 07:03:06 -0000 1.9 *************** *** 36,47 **** single = types.length==1; ! names = new String[types.length][]; ! for (int i=0; i<types.length; i++) { ! int span = types[i].getColumnSpan( sess.getFactory() ); ! names[i] = new String[span]; ! for ( int j=0; j<span; j++ ) { ! names[i][j] = QueryTranslator.scalarName(i, j); ! } ! } postNext( rs.next() ); --- 36,40 ---- single = types.length==1; ! names = QueryTranslator.generateColumnNames( types, sess.getFactory() ); postNext( rs.next() ); |
From: <one...@us...> - 2002-11-22 07:03:10
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv5673/hibernate/query Modified Files: PathExpressionParser.java QueryTranslator.java SelectParser.java Log Message: experimental support for scalar selects in find() Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/PathExpressionParser.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** PathExpressionParser.java 22 Nov 2002 01:07:12 -0000 1.64 --- PathExpressionParser.java 22 Nov 2002 07:03:07 -0000 1.65 *************** *** 175,178 **** --- 175,179 ---- } + componentPath = null; } else if ( propertyType.isPersistentCollectionType() ) { *************** *** 188,205 **** currentName=null; currentProperty=null; } else { ! throw new QueryException( "dereferenced: " + ! currentProperty + ! " (possibly a scalar value appears in the select clause)" ); } - componentPath = null; } - //prepare the next LHS } } --- 189,204 ---- currentName=null; currentProperty=null; + componentPath = null; } else { ! if (token!=null) throw new QueryException( "dereferenced: " + ! currentProperty ); } } } } Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** QueryTranslator.java 20 Nov 2002 07:06:44 -0000 1.45 --- QueryTranslator.java 22 Nov 2002 07:03:07 -0000 1.46 *************** *** 414,420 **** private String renderSQL() throws QueryException, MappingException { boolean isSubselect = superQuery!=null; ! if ( returnTypes.size()==0 ) { returnTypes = fromTypes; } --- 414,423 ---- private String renderSQL() throws QueryException, MappingException { + String selectPerhapsDistinct = "SELECT "; + if (distinct) selectPerhapsDistinct += "DISTINCT "; + boolean isSubselect = superQuery!=null; ! if ( returnTypes.size()==0 && scalarTypes.size()==0) { returnTypes = fromTypes; } *************** *** 430,436 **** } ! StringBuffer buf = new StringBuffer(20).append("SELECT "); ! ! if (distinct) buf.append("DISTINCT "); if ( scalarTypes.size()==0 ) { --- 433,437 ---- } ! StringBuffer buf = new StringBuffer(20); if ( scalarTypes.size()==0 ) { *************** *** 490,494 **** } ! scalarSelectString = buf.toString(); int ttsize = scalarTypes.size(); --- 491,496 ---- } ! String scalarSelectString = buf.toString(); ! this.scalarSelectString = selectPerhapsDistinct + scalarSelectString; //TODO: clean up int ttsize = scalarTypes.size(); *************** *** 501,507 **** // depending upon how the query is to return its results ! buf = new StringBuffer(40).append("SELECT "); ! ! if (distinct) buf.append("DISTINCT ");; for ( int k=0; k<size; k++ ) { --- 503,507 ---- // depending upon how the query is to return its results ! buf = new StringBuffer(40); for ( int k=0; k<size; k++ ) { *************** *** 512,516 **** } ! selectIDString = buf.toString(); for ( int k=0; k<size; k++ ) { --- 512,516 ---- } ! selectIDString = selectPerhapsDistinct + buf.toString(); for ( int k=0; k<size; k++ ) { *************** *** 520,524 **** } ! selectPropertiesString = buf.toString(); //FROM --- 520,527 ---- } ! selectPropertiesString = selectPerhapsDistinct + ! buf.append( (size==0) ? "" : ", " ) ! .append(scalarSelectString) ! .toString(); //FROM *************** *** 842,845 **** --- 845,860 ---- } return StringHelper.multiply( query, placeholders.iterator(), replacements.iterator() ); + } + + public static String[][] generateColumnNames(Type[] types, SessionFactoryImplementor f) throws MappingException { + String[][] names = new String[types.length][]; + for (int i=0; i<types.length; i++) { + int span = types[i].getColumnSpan(f); + names[i] = new String[span]; + for ( int j=0; j<span; j++ ) { + names[i][j] = scalarName(i, j); + } + } + return names; } } Index: SelectParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/SelectParser.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** SelectParser.java 19 Nov 2002 15:28:07 -0000 1.34 --- SelectParser.java 22 Nov 2002 07:03:07 -0000 1.35 *************** *** 81,87 **** else if ( aggregateFunctions.contains(lctoken) ) { if (!ready) throw new QueryException(", expected before aggregate function in SELECT: " + token); ! if ( !q.supportsScalars() ) throw new QueryException( "aggregate functions may only be used in the select clause of iterate() queries: " + token ! ); if ( lctoken.equals("count") ) { q.addScalarType(Hibernate.INTEGER); --- 81,87 ---- else if ( aggregateFunctions.contains(lctoken) ) { if (!ready) throw new QueryException(", expected before aggregate function in SELECT: " + token); ! /*if ( !q.supportsScalars() ) throw new QueryException( "aggregate functions may only be used in the select clause of iterate() queries: " + token ! );*/ if ( lctoken.equals("count") ) { q.addScalarType(Hibernate.INTEGER); |
From: <one...@us...> - 2002-11-22 07:03:10
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv5673/hibernate/loader Modified Files: Loader.java Log Message: experimental support for scalar selects in find() Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Loader.java 20 Nov 2002 14:20:08 -0000 1.28 --- Loader.java 22 Nov 2002 07:03:07 -0000 1.29 *************** *** 25,28 **** --- 25,29 ---- import cirrus.hibernate.impl.QueryImpl; import cirrus.hibernate.persister.*; + import cirrus.hibernate.query.QueryTranslator; import cirrus.hibernate.type.Type; *************** *** 71,74 **** --- 72,79 ---- } + protected Type[] getReturnTypes() { + return null; + } + /** * Execute an SQL query and attempt to instantiate instances of the class mapped by the given *************** *** 109,112 **** --- 114,123 ---- //success = true; } + + String[][] names = null; + final Type[] returnTypes = getReturnTypes(); + if ( returnTypes!=null ) { + names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() ); + } final List results = new ArrayList(); //new cirrus.hibernate.collections.List(this); *************** *** 149,153 **** if (returnProxies) row[i] = session.proxyFor( persisters[i], keys[i], row[i] ); } ! results.add( ( cols==1 ) ? row[0] : row ); if (collection) optionalCollection.readFrom( rs, getCollectionPersister() ); --- 160,181 ---- if (returnProxies) row[i] = session.proxyFor( persisters[i], keys[i], row[i] ); } ! ! if (returnTypes==null) { ! ! results.add( ( cols==1 ) ? row[0] : row ); ! ! } ! else { ! int queryCols = returnTypes.length; ! if ( queryCols==1 ) { ! results.add( returnTypes[0].nullSafeGet( rs, names[0], session, null ) ); ! } ! else { ! Object[] queryRow = new Object[queryCols]; ! for ( int i=0; i<queryCols; i++ ) ! queryRow[i] = returnTypes[i].nullSafeGet( rs, names[i], session, null ); ! results.add(queryRow); ! } ! } if (collection) optionalCollection.readFrom( rs, getCollectionPersister() ); |
From: <one...@us...> - 2002-11-22 07:03:10
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv5673/hibernate/test Modified Files: FooBarTest.java Log Message: experimental support for scalar selects in find() Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.225 retrieving revision 1.226 diff -C2 -d -r1.225 -r1.226 *** FooBarTest.java 21 Nov 2002 07:51:18 -0000 1.225 --- FooBarTest.java 22 Nov 2002 07:03:07 -0000 1.226 *************** *** 828,831 **** --- 828,846 ---- assertTrue( !rs.hasNext() ); + list = s.find("select foo.long, foo.component.name, foo, foo.foo from foo in class Foo"); + rs = list.iterator(); + int count=0; + while ( rs.hasNext() ) { + count++; + Object[] row = (Object[]) rs.next(); + assertTrue( row[0] instanceof Long ); + assertTrue( row[1] instanceof String ); + assertTrue( row[2] instanceof Foo ); + assertTrue( row[3] instanceof Foo ); + } + assertTrue(count!=0); + list = s.find("select avg(foo.long), max(foo.component.name), count(distinct foo.id) from foo in class Foo"); + //s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work! + s.save( new Holder("ice T") ); s.save( new Holder("ice cube") ); |
From: <cel...@us...> - 2002-11-22 04:11:03
|
Update of /cvsroot/hibernate/Hibernate/bin In directory sc8-pr-cvs1:/tmp/cvs-serv1220 Added Files: ReverseGenerator.bat Log Message: Created batch file for ReverseGenerator CVSt: ---------------------------------------------------------------------- --- NEW FILE: ReverseGenerator.bat --- @echo off rem ------------------------------------------------------------------- rem Execute CodeGenerator tool rem ------------------------------------------------------------------- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.reverse.MapGui |
From: <cel...@us...> - 2002-11-22 04:05:23
|
Update of /cvsroot/hibernate/Hibernate/doc In directory sc8-pr-cvs1:/tmp/cvs-serv32471/Hibernate/doc Modified Files: tools.aft tools.aft-TOC tools.html Log Message: Added documentation for reverse engineering tool. Index: tools.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/tools.aft,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tools.aft 10 Nov 2002 03:40:55 -0000 1.37 --- tools.aft 22 Nov 2002 04:05:20 -0000 1.38 *************** *** 226,229 **** --- 226,258 ---- |--package=''package__suffix''| a string to append to the package name when generating the proxy package name (eg. |proxy|) + ----------------------------------------------------------------------- + **Reverse Engineering Tool + + The Reverse Engineering Tool may be used to generate Hibernate mapping files and Java source files from an existing database schema. Using database metadata, the tool retrieves table and column information and generates appropriate mapping files and Java source. + The tool is implemented as a small Swing application with several configuration screens: + ***Connection Panel + Configure the JDBC connection here. Note that the specified JDBC driver class must be in the classpath. + ***Tables + Select the tables for generation in this panel. Start by clicking the "tables" button at the top of the panel. Specify a catalog, schema, and table name pattern in the resulting dialog (the table name pattern is specified using SQL 'like' syntax). On exiting the dialog, the tables panel will display the selected database tables. You may select one or more tables for generation. + ***Mapping + The mapping panel may be used to configure the mapping file generator. + + *|Mapping File| - select to generate one mapping file for each database table, or to generate a single map for all tables. + + *|Key Field Name| - specify the name of the identifier property used in each Hibernate class + + *|Generator| - select the Hibernate generator that will assign identifier values. The |params| button produces a dialog for configuring generator parameters. + + *|Key Field Type| - select Hibernate types or Java types. Selecting Hibernate types will result in Java source using primitive field types, selecting Java types will result in Java source using object types (Integer, etc.). + + *|Key Field Class| - specify the type of key field to be used in the mapping file and generated source. + + ***Code + *|Package Name| - sets the package name for generated Java source + + *|Base Class Name| - set a base class for generated Java source files. useful if you want to consolidate common behavior in Hibernate classes. + + ***Output + *|Output Directory| - sets the output directory for the generated mapping file and Java sources. Note that all files will be created in a directory according to the package name, relative to the output directory specified here. #---PASS-HTML <A href=http://sourceforge.net/projects/hibernate><IMG src=http://sourceforge.net/sflogo.php?group_id=40712></A> Index: tools.aft-TOC =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/tools.aft-TOC,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tools.aft-TOC 10 Nov 2002 03:40:55 -0000 1.22 --- tools.aft-TOC 22 Nov 2002 04:05:20 -0000 1.23 *************** *** 16,17 **** --- 16,23 ---- * {-Proxy Generation@Proxy Generation-} * {-command line options@command line options-} + * {-Reverse Engineering Tool@Reverse Engineering Tool-} + * {-Connection Panel@Connection Panel-} + * {-Tables@Tables-} + * {-Mapping@Mapping-} + * {-Code@Code-} + * {-Output@Output-} Index: tools.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/tools.html,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** tools.html 10 Nov 2002 03:40:55 -0000 1.80 --- tools.html 22 Nov 2002 04:05:20 -0000 1.81 *************** *** 42,46 **** <li> <a href="#Proxy Generation">Proxy Generation</a></li> <ul> ! <li> <a href="#command line options">command line options</a> </li> --- 42,54 ---- <li> <a href="#Proxy Generation">Proxy Generation</a></li> <ul> ! <li> <a href="#command line options">command line options</a></li> ! </ul> ! <li> <a href="#Reverse Engineering Tool">Reverse Engineering Tool</a></li> ! <ul> ! <li> <a href="#Connection Panel">Connection Panel</a></li> ! <li> <a href="#Tables">Tables</a></li> ! <li> <a href="#Mapping">Mapping</a></li> ! <li> <a href="#Code">Code</a></li> ! <li> <a href="#Output">Output</a> </li> *************** *** 337,341 **** <tt>--package=<em>package_suffix</em></tt> a string to append to the package name when generating the proxy package name (eg. <tt>proxy</tt>) </p> ! <A href=http://sourceforge.net/projects/hibernate><IMG src=http://sourceforge.net/sflogo.php?group_id=40712></A><!--End Section 3--> <!-- End SectLevel3 --> <!--End Section 2--> --- 345,401 ---- <tt>--package=<em>package_suffix</em></tt> a string to append to the package name when generating the proxy package name (eg. <tt>proxy</tt>) </p> ! <hr> ! <!--End Section 3--> ! <!-- End SectLevel3 --> ! <!--End Section 2--> ! <h3><a name="Reverse Engineering Tool">Reverse Engineering Tool</a></h3> ! <p class="Body"> ! The Reverse Engineering Tool may be used to generate Hibernate mapping files and Java source files from an existing database schema. Using database metadata, the tool retrieves table and column information and generates appropriate mapping files and Java source. ! The tool is implemented as a small Swing application with several configuration screens: ! </p> ! <!-- Start SectLevel3 --> ! <h4><a name="Connection Panel">Connection Panel</a></h4> ! <p class="Body"> ! Configure the JDBC connection here. Note that the specified JDBC driver class must be in the classpath. ! </p> ! <!--End Section 3--> ! <h4><a name="Tables">Tables</a></h4> ! <p class="Body"> ! Select the tables for generation in this panel. Start by clicking the "tables" button at the top of the panel. Specify a catalog, schema, and table name pattern in the resulting dialog (the table name pattern is specified using SQL 'like' syntax). On exiting the dialog, the tables panel will display the selected database tables. You may select one or more tables for generation. ! </p> ! <!--End Section 3--> ! <h4><a name="Mapping">Mapping</a></h4> ! <p class="Body"> ! The mapping panel may be used to configure the mapping file generator. ! </p> ! <ul> ! <li><tt>Mapping File</tt> - select to generate one mapping file for each database table, or to generate a single map for all tables.</li> ! </ul> ! <ul> ! <li><tt>Key Field Name</tt> - specify the name of the identifier property used in each Hibernate class</li> ! </ul> ! <ul> ! <li><tt>Generator</tt> - select the Hibernate generator that will assign identifier values. The <tt>params</tt> button produces a dialog for configuring generator parameters.</li> ! </ul> ! <ul> ! <li><tt>Key Field Type</tt> - select Hibernate types or Java types. Selecting Hibernate types will result in Java source using primitive field types, selecting Java types will result in Java source using object types (Integer, etc.).</li> ! </ul> ! <ul> ! <li><tt>Key Field Class</tt> - specify the type of key field to be used in the mapping file and generated source.</li> ! </ul> ! <!--End Section 3--> ! <h4><a name="Code">Code</a></h4> ! <ul> ! <li><tt>Package Name</tt> - sets the package name for generated Java source</li> ! </ul> ! <ul> ! <li><tt>Base Class Name</tt> - set a base class for generated Java source files. useful if you want to consolidate common behavior in Hibernate classes.</li> ! </ul> ! <!--End Section 3--> ! <h4><a name="Output">Output</a></h4> ! <ul> ! <li><tt>Output Directory</tt> - sets the output directory for the generated mapping file and Java sources. Note that all files will be created in a directory according to the package name, relative to the output directory specified here.<A href=http://sourceforge.net/projects/hibernate><IMG src=http://sourceforge.net/sflogo.php?group_id=40712></A></li> ! </ul> ! <!--End Section 3--> <!-- End SectLevel3 --> <!--End Section 2--> |
From: <one...@us...> - 2002-11-22 01:07:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv30262/hibernate/query Modified Files: PathExpressionParser.java Log Message: removed static final Log from exception classes provided composite key support for expressions with [] Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/PathExpressionParser.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** PathExpressionParser.java 21 Nov 2002 07:44:57 -0000 1.63 --- PathExpressionParser.java 22 Nov 2002 01:07:12 -0000 1.64 *************** *** 64,74 **** q.addType( currentName, clazz.getName() ); ! join.append(" and ") ! .append( joinColumns[0] ) ! .append('=') ! .append(currentName) ! .append('.') ! .append( q.getPersister(clazz).getIdentifierColumnNames()[0] ); ! //TODO: composite keys! return currentName; } --- 64,75 ---- q.addType( currentName, clazz.getName() ); ! for ( int i=0; i<joinColumns.length; i++ ) { ! join.append(" and ") ! .append( joinColumns[i] ) ! .append('=') ! .append(currentName) ! .append('.') ! .append( q.getPersister(clazz).getIdentifierColumnNames()[i] ); ! } return currentName; } *************** *** 84,94 **** collectionTable = p.getQualifiedTableName(); ! join.append(" and ") ! .append( joinColumns[0] ) ! .append('=') ! .append(collectionName) ! .append('.') ! .append( p.getKeyColumnNames()[0] ); ! //TODO: composite keys! return collectionName; } --- 85,96 ---- collectionTable = p.getQualifiedTableName(); ! for ( int i=0; i<joinColumns.length; i++ ) { ! join.append(" and ") ! .append( joinColumns[i] ) ! .append('=') ! .append(collectionName) ! .append('.') ! .append( p.getKeyColumnNames()[i] ); ! } return collectionName; } |
From: <one...@us...> - 2002-11-22 01:07:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv30262/hibernate Modified Files: LazyInitializationException.java StaleObjectStateException.java Log Message: removed static final Log from exception classes provided composite key support for expressions with [] Index: LazyInitializationException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/LazyInitializationException.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LazyInitializationException.java 28 Oct 2002 19:37:20 -0000 1.5 --- LazyInitializationException.java 22 Nov 2002 01:07:11 -0000 1.6 *************** *** 3,7 **** import org.apache.commons.lang.exception.NestableRuntimeException; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; --- 3,6 ---- *************** *** 14,19 **** public class LazyInitializationException extends NestableRuntimeException { - private static final Log log = LogFactory.getLog(LazyInitializationException.class); - public LazyInitializationException(Exception root) { super("Hibernate lazy instantiation problem", root); --- 13,16 ---- *************** *** 22,26 **** public LazyInitializationException(String msg) { super(msg); ! log.error(msg, this); } --- 19,23 ---- public LazyInitializationException(String msg) { super(msg); ! LogFactory.getLog(LazyInitializationException.class).error(msg, this); } Index: StaleObjectStateException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/StaleObjectStateException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StaleObjectStateException.java 24 Jul 2002 14:03:18 -0000 1.4 --- StaleObjectStateException.java 22 Nov 2002 01:07:11 -0000 1.5 *************** *** 4,8 **** import java.io.Serializable; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; --- 4,7 ---- *************** *** 14,21 **** public class StaleObjectStateException extends HibernateException { ! ! private static final Log log = LogFactory.getLog(StaleObjectStateException.class); ! ! private final Class persistentClass; private final Serializable identifier; --- 13,17 ---- public class StaleObjectStateException extends HibernateException { ! private final Class persistentClass; private final Serializable identifier; *************** *** 24,28 **** this.persistentClass = persistentClass; this.identifier = identifier; ! log.error("An operation failed due to stale data", this); } --- 20,24 ---- this.persistentClass = persistentClass; this.identifier = identifier; ! LogFactory.getLog(StaleObjectStateException.class).error("An operation failed due to stale data", this); } |
From: <one...@us...> - 2002-11-22 00:27:12
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv22494/hibernate/type Modified Files: CalendarType.java Added Files: CalendarDateType.java Log Message: fixed a couple of bugs in multitable mappings fixed an npe in CalendarType --- NEW FILE: CalendarDateType.java --- //$Id: CalendarDateType.java,v 1.1 2002/11/22 00:27:09 oneovthafew Exp $ package cirrus.hibernate.type; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import java.util.Calendar; import java.util.GregorianCalendar; import cirrus.hibernate.HibernateException; /** * A type mapping for a <tt>Calendar</tt> object that represents a date. */ public class CalendarDateType extends MutableType { /** * @see cirrus.hibernate.type.NullableType#get(ResultSet, String) */ public Object get(ResultSet rs, String name) throws HibernateException, SQLException { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis( rs.getDate(name).getTime() ); return cal; } /** * @see cirrus.hibernate.type.NullableType#set(PreparedStatement, Object, int) */ public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { st.setDate( index, new Date( ( (Calendar) value ).getTimeInMillis() ) ); } /** * @see cirrus.hibernate.type.NullableType#sqlType() */ public int sqlType() { return Types.DATE; } /** * @see cirrus.hibernate.type.NullableType#toXML(Object) */ public String toXML(Object value) throws HibernateException { //TODO: return value.toString(); } /** * @see cirrus.hibernate.type.NullableType#deepCopyNotNull(Object) */ public Object deepCopyNotNull(Object value) throws HibernateException { return ( (Calendar) value ).clone(); } /** * @see cirrus.hibernate.type.Type#returnedClass() */ public Class returnedClass() { return Calendar.class; } /** * @see cirrus.hibernate.type.Type#equals(Object, Object) */ public boolean equals(Object x, Object y) throws HibernateException { if (x==y) return true; if (x==null || y==null) return false; Calendar calendar1 = (Calendar) x; Calendar calendar2 = (Calendar) y; return calendar1.get(Calendar.DAY_OF_MONTH) == calendar2.get(Calendar.DAY_OF_MONTH) && calendar1.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH) && calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR); } /** * @see cirrus.hibernate.type.Type#getName() */ public String getName() { return "calendar_date"; } } Index: CalendarType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/CalendarType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CalendarType.java 21 Nov 2002 09:05:03 -0000 1.1 --- CalendarType.java 22 Nov 2002 00:27:09 -0000 1.2 *************** *** 22,28 **** public Object get(ResultSet rs, String name) throws HibernateException, SQLException { ! Calendar cal = new GregorianCalendar(); ! cal.setTimeInMillis( rs.getTimestamp(name).getTime() ); ! return cal; } --- 22,36 ---- public Object get(ResultSet rs, String name) throws HibernateException, SQLException { ! ! Timestamp ts = rs.getTimestamp(name); ! if (ts!=null) { ! Calendar cal = new GregorianCalendar(); ! cal.setTimeInMillis( ts.getTime() ); ! return cal; ! } ! else { ! return null; ! } ! } |
From: <one...@us...> - 2002-11-22 00:27:12
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv22494/hibernate/test Modified Files: Multi.hbm.xml Multi.java SubMulti.java Log Message: fixed a couple of bugs in multitable mappings fixed an npe in CalendarType Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.hbm.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Multi.hbm.xml 5 Nov 2002 13:40:53 -0000 1.13 --- Multi.hbm.xml 22 Nov 2002 00:27:09 -0000 1.14 *************** *** 30,36 **** --- 30,46 ---- <many-to-one name="other" column="other2" class="cirrus.hibernate.test.Multi" /> + <component name="comp" class="cirrus.hibernate.test.Multi$Component"> + <property name="cal"/> + <property name="floaty"/> + </component> + <joined-subclass name="cirrus.hibernate.test.SubMulti" table="submulti"> <key column="sid"/> <property name="amount"/> + <bag role="children" lazy="true" readonly="true"> + <key column="parent"/> + <one-to-many class="cirrus.hibernate.test.SubMulti"/> + </bag> + <many-to-one name="parent"/> </joined-subclass> Index: Multi.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Multi.java 28 Sep 2002 16:04:57 -0000 1.1 --- Multi.java 22 Nov 2002 00:27:09 -0000 1.2 *************** *** 2,5 **** --- 2,7 ---- package cirrus.hibernate.test; + import java.util.Calendar; + public class Multi extends Simple { *************** *** 12,15 **** --- 14,18 ---- private String extraProp; + private Component comp; /** *************** *** 27,30 **** --- 30,86 ---- public void setExtraProp(String extraProp) { this.extraProp = extraProp; + } + + public static final class Component { + private Calendar cal; + private Float floaty; + /** + * Returns the cal. + * @return Calendar + */ + public Calendar getCal() { + return cal; + } + + /** + * Sets the cal. + * @param cal The cal to set + */ + public void setCal(Calendar cal) { + this.cal = cal; + } + + /** + * Returns the floaty. + * @return Float + */ + public Float getFloaty() { + return floaty; + } + + /** + * Sets the floaty. + * @param floaty The floaty to set + */ + public void setFloaty(Float floaty) { + this.floaty = floaty; + } + + } + + /** + * Returns the comp. + * @return Component + */ + public Component getComp() { + return comp; + } + + /** + * Sets the comp. + * @param comp The comp to set + */ + public void setComp(Component comp) { + this.comp = comp; } Index: SubMulti.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/SubMulti.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubMulti.java 11 Oct 2002 04:56:57 -0000 1.1 --- SubMulti.java 22 Nov 2002 00:27:09 -0000 1.2 *************** *** 2,7 **** --- 2,11 ---- package cirrus.hibernate.test; + import java.util.List; + public class SubMulti extends Multi { private float amount; + private SubMulti parent; + private List children; /** * Returns the amount. *************** *** 18,21 **** --- 22,57 ---- public void setAmount(float amount) { this.amount = amount; + } + + /** + * Returns the childen. + * @return List + */ + public List getChildren() { + return children; + } + + /** + * Returns the parent. + * @return SubMulti + */ + public SubMulti getParent() { + return parent; + } + + /** + * Sets the childen. + * @param childen The childen to set + */ + public void setChildren(List children) { + this.children = children; + } + + /** + * Sets the parent. + * @param parent The parent to set + */ + public void setParent(SubMulti parent) { + this.parent = parent; } |
From: <one...@us...> - 2002-11-22 00:27:11
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv22494/hibernate/persister Modified Files: MultiTableEntityPersister.java Log Message: fixed a couple of bugs in multitable mappings fixed an npe in CalendarType Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MultiTableEntityPersister.java 21 Nov 2002 08:08:33 -0000 1.32 --- MultiTableEntityPersister.java 22 Nov 2002 00:27:09 -0000 1.33 *************** *** 447,453 **** for (int i=0; i<propertyColumnNames.length; i++) { if ( propertyTables[i]==j ) { ! for ( int k=0; k<propertyColumnNames[i].length; k++ ) setters.append( propertyColumnNames[i][k] ).append(" = ?, "); hasColumns = true; } } --- 447,454 ---- for (int i=0; i<propertyColumnNames.length; i++) { if ( propertyTables[i]==j ) { ! for ( int k=0; k<propertyColumnNames[i].length; k++ ) { setters.append( propertyColumnNames[i][k] ).append(" = ?, "); hasColumns = true; + } } } |
From: <one...@us...> - 2002-11-22 00:27:11
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map In directory sc8-pr-cvs1:/tmp/cvs-serv22494/hibernate/map Modified Files: Component.java Value.java Log Message: fixed a couple of bugs in multitable mappings fixed an npe in CalendarType Index: Component.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Component.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Component.java 27 Oct 2002 18:30:56 -0000 1.33 --- Component.java 22 Nov 2002 00:27:08 -0000 1.34 *************** *** 54,57 **** --- 54,58 ---- public Component(Node node, Class reflectedClass, String path, PersistentClass owner, boolean isNullable, Table table, Root root) throws MappingException { super(); + setTable(table); Node classNode = node.getAttributes().getNamedItem("class"); String className; Index: Value.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Value.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Value.java 31 Oct 2002 14:00:28 -0000 1.40 --- Value.java 22 Nov 2002 00:27:08 -0000 1.41 *************** *** 38,42 **** return type; } ! public void setType(Type type) { this.type = type; Iterator iter = getColumnIterator(); --- 38,42 ---- return type; } ! void setType(Type type) { this.type = type; Iterator iter = getColumnIterator(); *************** *** 47,50 **** --- 47,53 ---- col.setTypeIndex(count++); } + } + void setTable(Table table) { + this.table = table; } |
From: <one...@us...> - 2002-11-21 09:05:06
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv4317/cirrus/hibernate/type Added Files: CalendarType.java Log Message: calendar types --- NEW FILE: CalendarType.java --- //$Id: CalendarType.java,v 1.1 2002/11/21 09:05:03 oneovthafew Exp $ package cirrus.hibernate.type; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.sql.Types; import java.util.Calendar; import java.util.GregorianCalendar; import cirrus.hibernate.HibernateException; /** * A type mapping for a <tt>Calendar</tt> object that represents a datetime. */ public class CalendarType extends MutableType { /** * @see cirrus.hibernate.type.NullableType#get(ResultSet, String) */ public Object get(ResultSet rs, String name) throws HibernateException, SQLException { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis( rs.getTimestamp(name).getTime() ); return cal; } /** * @see cirrus.hibernate.type.NullableType#set(PreparedStatement, Object, int) */ public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { st.setTimestamp( index, new Timestamp( ( (Calendar) value ).getTimeInMillis() ) ); } /** * @see cirrus.hibernate.type.NullableType#sqlType() */ public int sqlType() { return Types.TIMESTAMP; } /** * @see cirrus.hibernate.type.NullableType#toXML(Object) */ public String toXML(Object value) throws HibernateException { //TODO: return value.toString(); } /** * @see cirrus.hibernate.type.NullableType#deepCopyNotNull(Object) */ public Object deepCopyNotNull(Object value) throws HibernateException { return ( (Calendar) value ).clone(); } /** * @see cirrus.hibernate.type.Type#returnedClass() */ public Class returnedClass() { return Calendar.class; } /** * @see cirrus.hibernate.type.Type#equals(Object, Object) */ public boolean equals(Object x, Object y) throws HibernateException { if (x==y) return true; if (x==null || y==null) return false; Calendar calendar1 = (Calendar) x; Calendar calendar2 = (Calendar) y; return calendar1.get(Calendar.MILLISECOND) == calendar2.get(Calendar.MILLISECOND) && calendar1.get(Calendar.SECOND) == calendar2.get(Calendar.SECOND) && calendar1.get(Calendar.MINUTE) == calendar2.get(Calendar.MINUTE) && calendar1.get(Calendar.HOUR_OF_DAY) == calendar2.get(Calendar.HOUR_OF_DAY) && calendar1.get(Calendar.DAY_OF_MONTH) == calendar2.get(Calendar.DAY_OF_MONTH) && calendar1.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH) && calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR); } /** * @see cirrus.hibernate.type.Type#getName() */ public String getName() { return "calendar"; } } |
Update of /cvsroot/hibernate/Hibernate/doc/reference/html In directory sc8-pr-cvs1:/tmp/cvs-serv679/doc/reference/html Modified Files: adv-or-mapping.html examples.html index.html manipulating-data.html or-mapping.html session-configuration.html Log Message: calendar types Index: adv-or-mapping.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/adv-or-mapping.html,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** adv-or-mapping.html 5 Nov 2002 13:40:53 -0000 1.25 --- adv-or-mapping.html 21 Nov 2002 09:03:15 -0000 1.26 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s1" title="5.1. Collections"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s2" title="5.2. Components"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s3" title="5.3. Cache"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s4" title="5.4. Proxies for Lazy Initialization"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1. <a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Collection Example</a></dt></dl></dd><dt>5.2. <a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>5.1. Collections</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Collection Example</a></dt></dl></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>5.1.1. Persistent Collection Styles</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s1" title="5.1. Collections"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s2" title="5.2. Components"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s3" title="5.3. Cache"><link rel="section" href="adv-or-mapping.html#adv-or-mapping-s4" title="5.4. Proxies for Lazy Initialization"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1. <a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt>5.2. <a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>5.1. Collections</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>5.1.1. Persistent Collection Styles</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more *************** *** 327,331 **** .... <many-to-one name="parent" class="eg.Parent" column="parent_id"/> ! </class></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-10"></a>5.1.11. Ternary Associations</h3></div></div><p> There are two possible approaches to mapping a ternary association. One approach is to use composite elements (discussed below). Another is to use a <tt>Map</tt> with an --- 327,331 ---- .... <many-to-one name="parent" class="eg.Parent" column="parent_id"/> ! </class></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-11"></a>5.1.11. Ternary Associations</h3></div></div><p> There are two possible approaches to mapping a ternary association. One approach is to use composite elements (discussed below). Another is to use a <tt>Map</tt> with an *************** *** 339,343 **** <index-many-to-many column="node2_id" class="Node"/> <many-to-many column="connection_id" class="Connection"/> ! </map></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-11"></a>5.1.12. Collection Example</h3></div></div><p> The previous sections are pretty confusing. So lets look at an example. This class: --- 339,343 ---- <index-many-to-many column="node2_id" class="Node"/> <many-to-many column="connection_id" class="Connection"/> ! </map></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-12"></a>5.1.12. Collection Example</h3></div></div><p> The previous sections are pretty confusing. So lets look at an example. This class: Index: examples.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/examples.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** examples.html 28 Oct 2002 08:50:20 -0000 1.3 --- examples.html 21 Nov 2002 09:03:16 -0000 1.4 *************** *** 126,130 **** <id name="id" column="id"> ! <generator class="native"/> </id> --- 126,130 ---- <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> </id> Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/index.html,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** index.html 5 Nov 2002 13:40:53 -0000 1.34 --- index.html 21 Nov 2002 09:03:16 -0000 1.35 *************** *** 1,3 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="next" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Hibernate Reference Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><hr noshade="true"></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="architecture.html">Architecture</a></dt><dd><dl><dt>1.1. <a href="architecture.html#architecture-s1">Overview</a></dt><dt>1.2. <a href="architecture.html#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="architecture.html#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="session-configuration.html">SessionFactory Configuration</a></dt><dd><dl><dt>2.1. <a href="session-configuration.html#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="session-configuration.html#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="session-configuration.html#session-configuration-s3">User provided JDBC Connection</a></dt><dt>2.4. <a href="session-configuration.html#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="session-configuration.html#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="session-configuration.html#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="session-configuration.html#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="persistent-classes.html">Persistent Classes</a></dt><dd><dl><dt>3.1. <a href="persistent-classes.html#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt>3.1.1. <a href="persistent-classes.html#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt>3.1.2. <a href="persistent-classes.html#persistent-classes-s1-2">Implement a default constructor</a></dt><dt>3.1.3. <a href="persistent-classes.html#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt>3.2. <a href="persistent-classes.html#persistent-classes-s2">Inheritance</a></dt><dt>3.3. <a href="persistent-classes.html#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt>3.4. <a href="persistent-classes.html#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="or-mapping.html">Basic O/R Mapping</a></dt><dd><dl><dt>4.1. <a href="or-mapping.html#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt>4.1.1. <a href="or-mapping.html#or-mapping-s1-1">Doctype</a></dt><dt>4.1.2. <a href="or-mapping.html#or-mapping-s1-2">hibernate-mapping</a></dt><dt>4.1.3. <a href="or-mapping.html#or-mapping-s1-3">class</a></dt><dt>4.1.4. <a href="or-mapping.html#or-mapping-s1-4">id</a></dt><dt>4.1.5. <a href="or-mapping.html#or-mapping-s1-4b">composite-id</a></dt><dt>4.1.6. <a href="or-mapping.html#or-mapping-s1-5">discriminator</a></dt><dt>4.1.7. <a href="or-mapping.html#or-mapping-s1-6">version (optional)</a></dt><dt>4.1.8. <a href="or-mapping.html#or-mapping-s1-6b">timestamp (optional)</a></dt><dt>4.1.9. <a href="or-mapping.html#or-mapping-s1-7">property</a></dt><dt>4.1.10. <a href="or-mapping.html#or-mapping-s1-8">many-to-one</a></dt><dt>4.1.11. <a href="or-mapping.html#or-mapping-s1-9">one-to-one</a></dt><dt>4.1.12. <a href="or-mapping.html#or-mapping-s1-10">component</a></dt><dt>4.1.13. <a href="or-mapping.html#or-mapping-s1-11">subclass</a></dt><dt>4.1.14. <a href="or-mapping.html#or-mapping-s1-11b">joined-subclass</a></dt><dt>4.1.15. <a href="or-mapping.html#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt>4.2. <a href="or-mapping.html#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt>4.2.1. <a href="or-mapping.html#or-mapping-s2-1">Entities and values</a></dt><dt>4.2.2. <a href="or-mapping.html#or-mapping-s2-2">Basic value types</a></dt><dt>4.2.3. <a href="or-mapping.html#or-mapping-s2-3">Persistent enum types</a></dt><dt>4.2.4. <a href="or-mapping.html#or-mapping-s2-4">Custom value types</a></dt><dt>4.2.5. <a href="or-mapping.html#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="adv-or-mapping.html">Advanced O/R Mapping</a></dt><dd><dl><dt>5.1. <a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Collection Example</a></dt></dl></dd><dt>5.2. <a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="manipulating-data.html">Manipulating Persistent Data</a></dt><dd><dl><dt>6.1. <a href="manipulating-data.html#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="manipulating-data.html#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="manipulating-data.html#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="manipulating-data.html#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="manipulating-data.html#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="manipulating-data.html#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="manipulating-data.html#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="manipulating-data.html#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="manipulating-data.html#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="manipulating-data.html#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="manipulating-data.html#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="manipulating-data.html#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="manipulating-data.html#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="manipulating-data.html#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="manipulating-data.html#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13d">Exception handling</a></dt></dl></dd><dt>6.10. <a href="manipulating-data.html#manipulating-data-s17">Interceptors</a></dt></dl></dd><dt>7. <a href="query-language.html">Hibernate Query Language</a></dt><dd><dl><dt>7.1. <a href="query-language.html#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="query-language.html#query-language-s2">The from clause</a></dt><dt>7.3. <a href="query-language.html#query-language-s3">The select clause</a></dt><dt>7.4. <a href="query-language.html#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="query-language.html#query-language-s4">from collections</a></dt><dt>7.6. <a href="query-language.html#query-language-s5">The where clause</a></dt><dt>7.7. <a href="query-language.html#query-language-s6">Expressions</a></dt><dt>7.8. <a href="query-language.html#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="query-language.html#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="query-language.html#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="transactions.html">Transactions And Concurrency</a></dt><dd><dl><dt>8.1. <a href="transactions.html#transactions-s1">Datastores, Sessions and Factories</a></dt><dt>8.2. <a href="transactions.html#transactions-s3">Threads and connections</a></dt><dt>8.3. <a href="transactions.html#transactions-s5">Optimistic Locking / Versioning</a></dt><dd><dl><dt>8.3.1. <a href="transactions.html#transactions-s5-1">Long session with automatic versioning</a></dt><dt>8.3.2. <a href="transactions.html#transactions-s5-2">Many sessions with automatic versioning</a></dt><dt>8.3.3. <a href="transactions.html#transactions-s5-3">Application version checking</a></dt></dl></dd><dt>8.4. <a href="transactions.html#transactions-s2">Session disconnection</a></dt><dt>8.5. <a href="transactions.html#transactions-s4">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="examples.html">Examples</a></dt><dd><dl><dt>9.1. <a href="examples.html#examples-s0">Employer / Employee</a></dt><dt>9.2. <a href="examples.html#examples-s1">Author / Work</a></dt><dt>9.3. <a href="examples.html#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="best-practices.html">Best Practices</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Architecture</td></tr></table></div></body></html> \ No newline at end of file --- 1,3 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="next" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Hibernate Reference Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><hr noshade="true"></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="architecture.html">Architecture</a></dt><dd><dl><dt>1.1. <a href="architecture.html#architecture-s1">Overview</a></dt><dt>1.2. <a href="architecture.html#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="architecture.html#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="session-configuration.html">SessionFactory Configuration</a></dt><dd><dl><dt>2.1. <a href="session-configuration.html#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="session-configuration.html#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="session-configuration.html#session-configuration-s3">User provided JDBC connection</a></dt><dt>2.4. <a href="session-configuration.html#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="session-configuration.html#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="session-configuration.html#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="session-configuration.html#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="persistent-classes.html">Persistent Classes</a></dt><dd><dl><dt>3.1. <a href="persistent-classes.html#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt>3.1.1. <a href="persistent-classes.html#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt>3.1.2. <a href="persistent-classes.html#persistent-classes-s1-2">Implement a default constructor</a></dt><dt>3.1.3. <a href="persistent-classes.html#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt>3.2. <a href="persistent-classes.html#persistent-classes-s2">Inheritance</a></dt><dt>3.3. <a href="persistent-classes.html#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt>3.4. <a href="persistent-classes.html#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="or-mapping.html">Basic O/R Mapping</a></dt><dd><dl><dt>4.1. <a href="or-mapping.html#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt>4.1.1. <a href="or-mapping.html#or-mapping-s1-1">Doctype</a></dt><dt>4.1.2. <a href="or-mapping.html#or-mapping-s1-2">hibernate-mapping</a></dt><dt>4.1.3. <a href="or-mapping.html#or-mapping-s1-3">class</a></dt><dt>4.1.4. <a href="or-mapping.html#or-mapping-s1-4">id</a></dt><dt>4.1.5. <a href="or-mapping.html#or-mapping-s1-4b">composite-id</a></dt><dt>4.1.6. <a href="or-mapping.html#or-mapping-s1-5">discriminator</a></dt><dt>4.1.7. <a href="or-mapping.html#or-mapping-s1-6">version (optional)</a></dt><dt>4.1.8. <a href="or-mapping.html#or-mapping-s1-6b">timestamp (optional)</a></dt><dt>4.1.9. <a href="or-mapping.html#or-mapping-s1-7">property</a></dt><dt>4.1.10. <a href="or-mapping.html#or-mapping-s1-8">many-to-one</a></dt><dt>4.1.11. <a href="or-mapping.html#or-mapping-s1-9">one-to-one</a></dt><dt>4.1.12. <a href="or-mapping.html#or-mapping-s1-10">component</a></dt><dt>4.1.13. <a href="or-mapping.html#or-mapping-s1-11">subclass</a></dt><dt>4.1.14. <a href="or-mapping.html#or-mapping-s1-11b">joined-subclass</a></dt><dt>4.1.15. <a href="or-mapping.html#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt>4.2. <a href="or-mapping.html#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt>4.2.1. <a href="or-mapping.html#or-mapping-s2-1">Entities and values</a></dt><dt>4.2.2. <a href="or-mapping.html#or-mapping-s2-2">Basic value types</a></dt><dt>4.2.3. <a href="or-mapping.html#or-mapping-s2-3">Persistent enum types</a></dt><dt>4.2.4. <a href="or-mapping.html#or-mapping-s2-4">Custom value types</a></dt><dt>4.2.5. <a href="or-mapping.html#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="adv-or-mapping.html">Advanced O/R Mapping</a></dt><dd><dl><dt>5.1. <a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt>5.2. <a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="manipulating-data.html">Manipulating Persistent Data</a></dt><dd><dl><dt>6.1. <a href="manipulating-data.html#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="manipulating-data.html#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="manipulating-data.html#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="manipulating-data.html#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="manipulating-data.html#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="manipulating-data.html#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="manipulating-data.html#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="manipulating-data.html#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="manipulating-data.html#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="manipulating-data.html#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="manipulating-data.html#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="manipulating-data.html#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="manipulating-data.html#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="manipulating-data.html#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="manipulating-data.html#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt>6.10. <a href="manipulating-data.html#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="query-language.html">Hibernate Query Language</a></dt><dd><dl><dt>7.1. <a href="query-language.html#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="query-language.html#query-language-s2">The from clause</a></dt><dt>7.3. <a href="query-language.html#query-language-s3">The select clause</a></dt><dt>7.4. <a href="query-language.html#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="query-language.html#query-language-s4">from collections</a></dt><dt>7.6. <a href="query-language.html#query-language-s5">The where clause</a></dt><dt>7.7. <a href="query-language.html#query-language-s6">Expressions</a></dt><dt>7.8. <a href="query-language.html#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="query-language.html#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="query-language.html#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="transactions.html">Transactions And Concurrency</a></dt><dd><dl><dt>8.1. <a href="transactions.html#transactions-s1">Datastores, Sessions and Factories</a></dt><dt>8.2. <a href="transactions.html#transactions-s3">Threads and connections</a></dt><dt>8.3. <a href="transactions.html#transactions-s5">Optimistic Locking / Versioning</a></dt><dd><dl><dt>8.3.1. <a href="transactions.html#transactions-s5-1">Long session with automatic versioning</a></dt><dt>8.3.2. <a href="transactions.html#transactions-s5-2">Many sessions with automatic versioning</a></dt><dt>8.3.3. <a href="transactions.html#transactions-s5-3">Application version checking</a></dt></dl></dd><dt>8.4. <a href="transactions.html#transactions-s2">Session disconnection</a></dt><dt>8.5. <a href="transactions.html#transactions-s4">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="examples.html">Examples</a></dt><dd><dl><dt>9.1. <a href="examples.html#examples-s0">Employer / Employee</a></dt><dt>9.2. <a href="examples.html#examples-s1">Author / Work</a></dt><dt>9.3. <a href="examples.html#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="best-practices.html">Best Practices</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Architecture</td></tr></table></div></body></html> \ No newline at end of file Index: manipulating-data.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/manipulating-data.html,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** manipulating-data.html 28 Oct 2002 15:41:54 -0000 1.22 --- manipulating-data.html 21 Nov 2002 09:03:22 -0000 1.23 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 6. Manipulating Persistent Data</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="next" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"><link rel="section" href="manipulating-data.html#manipulating-data-s1" title="6.1. Creating a persistent object"><link rel="section" href="manipulating-data.html#manipulating-data-s2" title="6.2. Loading an object"><link rel="section" href="manipulating-data.html#manipulating-data-s3" title="6.3. Querying"><link rel="section" href="manipulating-data.html#manipulating-data-s7" title="6.4. Updating objects saved or loaded in the current session"><link rel="section" href="manipulating-data.html#manipulating-data-s8" title="6.5. Updating objects saved or loaded in a previous session"><link rel="section" href="manipulating-data.html#manipulating-data-s9" title="6.6. Deleting persistent objects"><link rel="section" href="manipulating-data.html#manipulating-data-s10" title="6.7. Graphs of objects"><link rel="section" href="manipulating-data.html#manipulating-data-s12" title="6.8. Flushing"><link rel="section" href="manipulating-data.html#manipulating-data-s13" title="6.9. Ending a Session"><link rel="section" href="manipulating-data.html#manipulating-data-s17" title="6.10. Interceptors"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Manipulating Persistent Data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="adv-or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="query-language.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="manipulating-data"></a>Chapter 6. Manipulating Persistent Data</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.1. <a href="manipulating-data.html#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="manipulating-data.html#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="manipulating-data.html#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="manipulating-data.html#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="manipulating-data.html#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="manipulating-data.html#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="manipulating-data.html#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="manipulating-data.html#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="manipulating-data.html#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="manipulating-data.html#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="manipulating-data.html#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="manipulating-data.html#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="manipulating-data.html#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="manipulating-data.html#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="manipulating-data.html#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13d">Exception handling</a></dt></dl></dd><dt>6.10. <a href="manipulating-data.html#manipulating-data-s17">Interceptors</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s1"></a>6.1. Creating a persistent object</h2></div></div><p> An object (entity instance) is either <span class="emphasis"><em>transient</em></span> or <span class="emphasis"><em>persistent</em></span> with respect to a particular --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 6. Manipulating Persistent Data</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="next" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="architecture.html" title="Chapter 1. Architecture"><link rel="chapter" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"><link rel="chapter" href="persistent-classes.html" title="Chapter 3. Persistent Classes"><link rel="chapter" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="chapter" href="adv-or-mapping.html" title="Chapter 5. Advanced O/R Mapping"><link rel="chapter" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"><link rel="chapter" href="query-language.html" title="Chapter 7. Hibernate Query Language"><link rel="chapter" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="chapter" href="examples.html" title="Chapter 9. Examples"><link rel="chapter" href="best-practices.html" title="Chapter 10. Best Practices"><link rel="section" href="manipulating-data.html#manipulating-data-s1" title="6.1. Creating a persistent object"><link rel="section" href="manipulating-data.html#manipulating-data-s2" title="6.2. Loading an object"><link rel="section" href="manipulating-data.html#manipulating-data-s3" title="6.3. Querying"><link rel="section" href="manipulating-data.html#manipulating-data-s7" title="6.4. Updating objects saved or loaded in the current session"><link rel="section" href="manipulating-data.html#manipulating-data-s8" title="6.5. Updating objects saved or loaded in a previous session"><link rel="section" href="manipulating-data.html#manipulating-data-s9" title="6.6. Deleting persistent objects"><link rel="section" href="manipulating-data.html#manipulating-data-s10" title="6.7. Graphs of objects"><link rel="section" href="manipulating-data.html#manipulating-data-s12" title="6.8. Flushing"><link rel="section" href="manipulating-data.html#manipulating-data-s13" title="6.9. Ending a Session"><link rel="section" href="manipulating-data.html#manipulating-data-s14" title="6.10. Interceptors"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Manipulating Persistent Data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="adv-or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="query-language.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="manipulating-data"></a>Chapter 6. Manipulating Persistent Data</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.1. <a href="manipulating-data.html#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="manipulating-data.html#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="manipulating-data.html#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="manipulating-data.html#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="manipulating-data.html#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="manipulating-data.html#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="manipulating-data.html#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="manipulating-data.html#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="manipulating-data.html#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="manipulating-data.html#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="manipulating-data.html#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="manipulating-data.html#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="manipulating-data.html#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="manipulating-data.html#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="manipulating-data.html#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt>6.10. <a href="manipulating-data.html#manipulating-data-s14">Interceptors</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s1"></a>6.1. Creating a persistent object</h2></div></div><p> An object (entity instance) is either <span class="emphasis"><em>transient</em></span> or <span class="emphasis"><em>persistent</em></span> with respect to a particular *************** *** 419,423 **** performance of some transactions. However, the session is now very clever about when it flushes before queries. ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s13"></a>6.9. Ending a Session</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13d">Exception handling</a></dt></dl></div><p> Ending a session involves four distinct phases: </p><div class="itemizedlist"><ul type="disc"><li><p> --- 419,423 ---- performance of some transactions. However, the session is now very clever about when it flushes before queries. ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s13"></a>6.9. Ending a Session</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.9.1. <a href="manipulating-data.html#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="manipulating-data.html#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="manipulating-data.html#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="manipulating-data.html#manipulating-data-s13-4">Exception handling</a></dt></dl></div><p> Ending a session involves four distinct phases: </p><div class="itemizedlist"><ul type="disc"><li><p> *************** *** 429,469 **** </p></li><li><p> handle exceptions ! </p></li></ul></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13b"></a>6.9.1. Flushing the session</h3></div></div><p> ! If you happen to be using the <tt>Transaction</tt> API, you don't ! need to worry about this step. It will be performed implicitly when the ! transaction is committed. Otherwise you should call ! <tt>Session.flush()</tt> to ensure that all changes are synchronized ! with the database. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13b"></a>6.9.2. Committing the transaction</h3></div></div><p> ! If you are using the Hibernate <tt>Transaction</tt> API, this looks like: ! </p><pre class="programlisting">tx.commit(); // flush the Session and commit the transaction</pre><p> ! If you are managing JDBC transactions yourself you should manually ! <tt>commit()</tt> the JDBC connection. ! </p><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource</pre><p> ! If you decide <span class="emphasis"><em>not</em></span> to commit your changes: ! </p><pre class="programlisting">tx.rollback(); // rollback the transaction</pre><p> ! or: ! </p><pre class="programlisting">//not necessary for JTA datasource, important otherwise ! sess.connection().rollback();</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13c"></a>6.9.3. Closing the session</h3></div></div><p> ! A call to <tt>Session.close()</tt> marks the end of a session. The main implication ! of <tt>close()</tt> is that the JDBC connection will be relinquished by the session. ! </p><pre class="programlisting">tx.commit(); sess.close();</pre><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource sess.close();</pre><p> ! If you provided your own connection, <tt>close()</tt> returns a reference ! to it, so you can manually close it or return it to the pool. Otherwise <tt>close() ! </tt> returns it to the pool. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13d"></a>6.9.4. Exception handling</h3></div></div><p> ! If the <tt>Session</tt> throws an exception (including ! any <tt>SQLException</tt>), you should immediately ! rollback the transaction, call <tt>Session.close()</tt> ! and discard the <tt>Session</tt> instance. Certain ! methods of <tt>Session</tt> will <span class="emphasis"><em>not</em></span> ! leave the session in a consistent state. ! </p><p> ! The following exception handling idiom is recommended: ! </p><pre class="programlisting">Session sess = factory.openSession(); Transaction tx = null; try { --- 429,469 ---- </p></li><li><p> handle exceptions ! </p></li></ul></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-1"></a>6.9.1. Flushing the session</h3></div></div><p> ! If you happen to be using the <tt>Transaction</tt> API, you don't ! need to worry about this step. It will be performed implicitly when the ! transaction is committed. Otherwise you should call ! <tt>Session.flush()</tt> to ensure that all changes are synchronized ! with the database. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-2"></a>6.9.2. Committing the transaction</h3></div></div><p> ! If you are using the Hibernate <tt>Transaction</tt> API, this looks like: ! </p><pre class="programlisting">tx.commit(); // flush the Session and commit the transact... [truncated message content] |
From: <one...@us...> - 2002-11-21 09:04:03
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html_single In directory sc8-pr-cvs1:/tmp/cvs-serv679/doc/reference/html_single Modified Files: index.html Log Message: calendar types Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html_single/index.html,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** index.html 19 Nov 2002 15:35:35 -0000 1.81 --- index.html 21 Nov 2002 09:03:27 -0000 1.82 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><hr noshade="true"></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#architecture">Architecture</a></dt><dd><dl><dt>1.1. <a href="#architecture-s1">Overview</a></dt><dt>1.2. <a href="#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="#session-configuration">SessionFactory Configuration</a></dt><dd><dl><dt>2.1. <a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="#session-configuration-s3">User provided JDBC Connection</a></dt><dt>2.4. <a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="#persistent-classes">Persistent Classes</a></dt><dd><dl><dt>3.1. <a href="#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt>3.1.1. <a href="#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt>3.1.2. <a href="#persistent-classes-s1-2">Implement a default constructor</a></dt><dt>3.1.3. <a href="#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt>3.2. <a href="#persistent-classes-s2">Inheritance</a></dt><dt>3.3. <a href="#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt>3.4. <a href="#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="#or-mapping">Basic O/R Mapping</a></dt><dd><dl><dt>4.1. <a href="#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt>4.1.1. <a href="#or-mapping-s1-1">Doctype</a></dt><dt>4.1.2. <a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt>4.1.3. <a href="#or-mapping-s1-3">class</a></dt><dt>4.1.4. <a href="#or-mapping-s1-4">id</a></dt><dt>4.1.5. <a href="#or-mapping-s1-4b">composite-id</a></dt><dt>4.1.6. <a href="#or-mapping-s1-5">discriminator</a></dt><dt>4.1.7. <a href="#or-mapping-s1-6">version (optional)</a></dt><dt>4.1.8. <a href="#or-mapping-s1-6b">timestamp (optional)</a></dt><dt>4.1.9. <a href="#or-mapping-s1-7">property</a></dt><dt>4.1.10. <a href="#or-mapping-s1-8">many-to-one</a></dt><dt>4.1.11. <a href="#or-mapping-s1-9">one-to-one</a></dt><dt>4.1.12. <a href="#or-mapping-s1-10">component</a></dt><dt>4.1.13. <a href="#or-mapping-s1-11">subclass</a></dt><dt>4.1.14. <a href="#or-mapping-s1-11b">joined-subclass</a></dt><dt>4.1.15. <a href="#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt>4.2. <a href="#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt>4.2.1. <a href="#or-mapping-s2-1">Entities and values</a></dt><dt>4.2.2. <a href="#or-mapping-s2-2">Basic value types</a></dt><dt>4.2.3. <a href="#or-mapping-s2-3">Persistent enum types</a></dt><dt>4.2.4. <a href="#or-mapping-s2-4">Custom value types</a></dt><dt>4.2.5. <a href="#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="#adv-or-mapping">Advanced O/R Mapping</a></dt><dd><dl><dt>5.1. <a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-11">Collection Example</a></dt></dl></dd><dt>5.2. <a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="#manipulating-data">Manipulating Persistent Data</a></dt><dd><dl><dt>6.1. <a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13d">Exception handling</a></dt></dl></dd><dt>6.10. <a href="#manipulating-data-s17">Interceptors</a></dt></dl></dd><dt>7. <a href="#query-language">Hibernate Query Language</a></dt><dd><dl><dt>7.1. <a href="#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="#query-language-s2">The from clause</a></dt><dt>7.3. <a href="#query-language-s3">The select clause</a></dt><dt>7.4. <a href="#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="#query-language-s4">from collections</a></dt><dt>7.6. <a href="#query-language-s5">The where clause</a></dt><dt>7.7. <a href="#query-language-s6">Expressions</a></dt><dt>7.8. <a href="#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="#transactions">Transactions And Concurrency</a></dt><dd><dl><dt>8.1. <a href="#transactions-s1">Datastores, Sessions and Factories</a></dt><dt>8.2. <a href="#transactions-s3">Threads and connections</a></dt><dt>8.3. <a href="#transactions-s5">Optimistic Locking / Versioning</a></dt><dd><dl><dt>8.3.1. <a href="#transactions-s5-1">Long session with automatic versioning</a></dt><dt>8.3.2. <a href="#transactions-s5-2">Many sessions with automatic versioning</a></dt><dt>8.3.3. <a href="#transactions-s5-3">Application version checking</a></dt></dl></dd><dt>8.4. <a href="#transactions-s2">Session disconnection</a></dt><dt>8.5. <a href="#transactions-s4">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="#examples">Examples</a></dt><dd><dl><dt>9.1. <a href="#examples-s0">Employer / Employee</a></dt><dt>9.2. <a href="#examples-s1">Author / Work</a></dt><dt>9.3. <a href="#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="#best-practices">Best Practices</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1.1. <a href="#architecture-s1">Overview</a></dt><dt>1.2. <a href="#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>1.1. Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.52.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><hr noshade="true"></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#architecture">Architecture</a></dt><dd><dl><dt>1.1. <a href="#architecture-s1">Overview</a></dt><dt>1.2. <a href="#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="#session-configuration">SessionFactory Configuration</a></dt><dd><dl><dt>2.1. <a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="#session-configuration-s3">User provided JDBC connection</a></dt><dt>2.4. <a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="#persistent-classes">Persistent Classes</a></dt><dd><dl><dt>3.1. <a href="#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt>3.1.1. <a href="#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt>3.1.2. <a href="#persistent-classes-s1-2">Implement a default constructor</a></dt><dt>3.1.3. <a href="#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt>3.2. <a href="#persistent-classes-s2">Inheritance</a></dt><dt>3.3. <a href="#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt>3.4. <a href="#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="#or-mapping">Basic O/R Mapping</a></dt><dd><dl><dt>4.1. <a href="#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt>4.1.1. <a href="#or-mapping-s1-1">Doctype</a></dt><dt>4.1.2. <a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt>4.1.3. <a href="#or-mapping-s1-3">class</a></dt><dt>4.1.4. <a href="#or-mapping-s1-4">id</a></dt><dt>4.1.5. <a href="#or-mapping-s1-4b">composite-id</a></dt><dt>4.1.6. <a href="#or-mapping-s1-5">discriminator</a></dt><dt>4.1.7. <a href="#or-mapping-s1-6">version (optional)</a></dt><dt>4.1.8. <a href="#or-mapping-s1-6b">timestamp (optional)</a></dt><dt>4.1.9. <a href="#or-mapping-s1-7">property</a></dt><dt>4.1.10. <a href="#or-mapping-s1-8">many-to-one</a></dt><dt>4.1.11. <a href="#or-mapping-s1-9">one-to-one</a></dt><dt>4.1.12. <a href="#or-mapping-s1-10">component</a></dt><dt>4.1.13. <a href="#or-mapping-s1-11">subclass</a></dt><dt>4.1.14. <a href="#or-mapping-s1-11b">joined-subclass</a></dt><dt>4.1.15. <a href="#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt>4.2. <a href="#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt>4.2.1. <a href="#or-mapping-s2-1">Entities and values</a></dt><dt>4.2.2. <a href="#or-mapping-s2-2">Basic value types</a></dt><dt>4.2.3. <a href="#or-mapping-s2-3">Persistent enum types</a></dt><dt>4.2.4. <a href="#or-mapping-s2-4">Custom value types</a></dt><dt>4.2.5. <a href="#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="#adv-or-mapping">Advanced O/R Mapping</a></dt><dd><dl><dt>5.1. <a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt>5.2. <a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="#manipulating-data">Manipulating Persistent Data</a></dt><dd><dl><dt>6.1. <a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt>6.10. <a href="#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="#query-language">Hibernate Query Language</a></dt><dd><dl><dt>7.1. <a href="#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="#query-language-s2">The from clause</a></dt><dt>7.3. <a href="#query-language-s3">The select clause</a></dt><dt>7.4. <a href="#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="#query-language-s4">from collections</a></dt><dt>7.6. <a href="#query-language-s5">The where clause</a></dt><dt>7.7. <a href="#query-language-s6">Expressions</a></dt><dt>7.8. <a href="#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="#transactions">Transactions And Concurrency</a></dt><dd><dl><dt>8.1. <a href="#transactions-s1">Datastores, Sessions and Factories</a></dt><dt>8.2. <a href="#transactions-s3">Threads and connections</a></dt><dt>8.3. <a href="#transactions-s5">Optimistic Locking / Versioning</a></dt><dd><dl><dt>8.3.1. <a href="#transactions-s5-1">Long session with automatic versioning</a></dt><dt>8.3.2. <a href="#transactions-s5-2">Many sessions with automatic versioning</a></dt><dt>8.3.3. <a href="#transactions-s5-3">Application version checking</a></dt></dl></dd><dt>8.4. <a href="#transactions-s2">Session disconnection</a></dt><dt>8.5. <a href="#transactions-s4">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="#examples">Examples</a></dt><dd><dl><dt>9.1. <a href="#examples-s0">Employer / Employee</a></dt><dt>9.2. <a href="#examples-s1">Author / Work</a></dt><dt>9.3. <a href="#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="#best-practices">Best Practices</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1.1. <a href="#architecture-s1">Overview</a></dt><dt>1.2. <a href="#architecture-s2">Persistent Object Identity</a></dt><dt>1.3. <a href="#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>1.1. Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> *************** *** 88,92 **** a JMX standard MBean but because most application servers do not yet support JMX, Hibernate also affords some non-standard configuration mechanisms. ! </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="session-configuration"></a>Chapter 2. SessionFactory Configuration</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>2.1. <a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="#session-configuration-s3">User provided JDBC Connection</a></dt><dt>2.4. <a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="#session-configuration-s7">Logging</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s1"></a>2.1. Programmatic Datastore Configuration</h2></div></div><p> An instance of <tt>cirrus.hibernate.Datastore</tt> represents an entire set of mappings of an application's Java types to a --- 88,92 ---- a JMX standard MBean but because most application servers do not yet support JMX, Hibernate also affords some non-standard configuration mechanisms. ! </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="session-configuration"></a>Chapter 2. SessionFactory Configuration</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>2.1. <a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt>2.2. <a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt>2.3. <a href="#session-configuration-s3">User provided JDBC connection</a></dt><dt>2.4. <a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt>2.5. <a href="#session-configuration-s5">Other properties</a></dt><dt>2.6. <a href="#session-configuration-s6">XML Configuration File</a></dt><dt>2.7. <a href="#session-configuration-s7">Logging</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s1"></a>2.1. Programmatic Datastore Configuration</h2></div></div><p> An instance of <tt>cirrus.hibernate.Datastore</tt> represents an entire set of mappings of an application's Java types to a *************** *** 120,124 **** Properties props = new Properties(); ... ! SessionFactory sessions = ds.buildSessionFactory(props);</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s3"></a>2.3. User provided JDBC Connection</h2></div></div><p> A <tt>SessionFactory</tt> may open a <tt>Session</tt> on a user-provided JDBC connection. This --- 120,124 ---- Properties props = new Properties(); ... ! SessionFactory sessions = ds.buildSessionFactory(props);</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s3"></a>2.3. User provided JDBC connection</h2></div></div><p> A <tt>SessionFactory</tt> may open a <tt>Session</tt> on a user-provided JDBC connection. This *************** *** 1109,1115 **** <tt>VARCHAR</tt> (or Oracle <tt>VARCHAR2</tt>). </p></dd><br><dt><span class="term"><tt>date, time, timestamp</tt></span></dt><dd><p> ! Type mappings from <tt>java.util.Date</tt> and its subclasses to ! SQL types <tt>DATE</tt>, <tt>TIME</tt> and <tt>TIMESTAMP</tt> (or equivalent). </p></dd><br><dt><span class="term"><tt>big_decimal</tt></span></dt><dd><p> A type mapping from <tt>java.math.BigDecimal</tt> to --- 1109,1119 ---- <tt>VARCHAR</tt> (or Oracle <tt>VARCHAR2</tt>). </p></dd><br><dt><span class="term"><tt>date, time, timestamp</tt></span></dt><dd><p> ! Type mappings from <tt>java.util.Date</tt> and its subclasses ! to SQL types <tt>DATE</tt>, <tt>TIME</tt> and <tt>TIMESTAMP</tt> (or equivalent). + </p></dd><br><dt><span class="term"><tt>calendar, calendar_date</tt></span></dt><dd><p> + Type mappings from <tt>java.util.Calendar</tt> to + SQL types <tt>TIMESTAMP</tt> and <tt>DATE</tt> + (or equivalent). </p></dd><br><dt><span class="term"><tt>big_decimal</tt></span></dt><dd><p> A type mapping from <tt>java.math.BigDecimal</tt> to *************** *** 1206,1210 **** <column name="class_name"/> <column name="id"/> ! </property></pre></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1. <a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-11">Collection Example</a></dt></dl></dd><dt>5.2. <a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>5.1. Collections</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-10">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-11">Collection Example</a></dt></dl></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>5.1.1. Persistent Collection Styles</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more --- 1210,1214 ---- <column name="class_name"/> <column name="id"/> ! </property></pre></div></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1. <a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt>5.2. <a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt>5.2.1. <a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt>5.2.2. <a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt>5.2.3. <a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt>5.2.4. <a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt>5.3. <a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt>5.3.1. <a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt>5.3.2. <a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt>5.3.3. <a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt>5.4. <a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>5.1. Collections</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>5.1.1. <a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt>5.1.2. <a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt>5.1.3. <a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt>5.1.4. <a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt>5.1.5. <a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt>5.1.6. <a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt>5.1.7. <a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt>5.1.8. <a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt>5.1.9. <a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt>5.1.10. <a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt>5.1.11. <a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt>5.1.12. <a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>5.1.1. Persistent Collection Styles</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more *************** *** 1532,1536 **** .... <many-to-one name="parent" class="eg.Parent" column="parent_id"/> ! </class></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-10"></a>5.1.11. Ternary Associations</h3></div></div><p> There are two possible approaches to mapping a ternary association. One approach is to use composite elements (discussed below). Another is to use a <tt>Map</tt> with an --- 1536,1540 ---- .... <many-to-one name="parent" class="eg.Parent" column="parent_id"/> ! </class></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-11"></a>5.1.11. Ternary Associations</h3></div></div><p> There are two possible approaches to mapping a ternary association. One approach is to use composite elements (discussed below). Another is to use a <tt>Map</tt> with an *************** *** 1544,1548 **** <index-many-to-many column="node2_id" class="Node"/> <many-to-many column="connection_id" class="Connection"/> ! </map></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-11"></a>5.1.12. Collection Example</h3></div></div><p> The previous sections are pretty confusing. So lets look at an example. This class: --- 1548,1552 ---- <index-many-to-many column="node2_id" class="Node"/> <many-to-many column="connection_id" class="Connection"/> ! </map></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-12"></a>5.1.12. Collection Example</h3></div></div><p> The previous sections are pretty confusing. So lets look at an example. This class: *************** *** 1968,1972 **** Exceptions that occur while initializing a proxy are wrapped in a <tt>LazyInitializationException</tt>. ! </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="manipulating-data"></a>Chapter 6. Manipulating Persistent Data</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.1. <a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13d">Exception handling</a></dt></dl></dd><dt>6.10. <a href="#manipulating-data-s17">Interceptors</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s1"></a>6.1. Creating a persistent object</h2></div></div><p> An object (entity instance) is either <span class="emphasis"><em>transient</em></span> or <span class="emphasis"><em>persistent</em></span> with respect to a particular --- 1972,1976 ---- Exceptions that occur while initializing a proxy are wrapped in a <tt>LazyInitializationException</tt>. ! </p></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="manipulating-data"></a>Chapter 6. Manipulating Persistent Data</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.1. <a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt>6.2. <a href="#manipulating-data-s2">Loading an object</a></dt><dt>6.3. <a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt>6.3.1. <a href="#manipulating-data-s4">Scalar queries</a></dt><dt>6.3.2. <a href="#manipulating-data-s5">The Query interface</a></dt><dt>6.3.3. <a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt>6.3.4. <a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt>6.4. <a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt>6.5. <a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt>6.6. <a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt>6.7. <a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt>6.7.1. <a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt>6.7.2. <a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt>6.8. <a href="#manipulating-data-s12">Flushing</a></dt><dt>6.9. <a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt>6.9.1. <a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt>6.10. <a href="#manipulating-data-s14">Interceptors</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s1"></a>6.1. Creating a persistent object</h2></div></div><p> An object (entity instance) is either <span class="emphasis"><em>transient</em></span> or <span class="emphasis"><em>persistent</em></span> with respect to a particular *************** *** 2386,2390 **** performance of some transactions. However, the session is now very clever about when it flushes before queries. ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s13"></a>6.9. Ending a Session</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.9.1. <a href="#manipulating-data-s13b">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13b">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13c">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13d">Exception handling</a></dt></dl></div><p> Ending a session involves four distinct phases: </p><div class="itemizedlist"><ul type="disc"><li><p> --- 2390,2394 ---- performance of some transactions. However, the session is now very clever about when it flushes before queries. ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s13"></a>6.9. Ending a Session</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>6.9.1. <a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt>6.9.2. <a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt>6.9.3. <a href="#manipulating-data-s13-3">Closing the session</a></dt><dt>6.9.4. <a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></div><p> Ending a session involves four distinct phases: </p><div class="itemizedlist"><ul type="disc"><li><p> *************** *** 2396,2436 **** </p></li><li><p> handle exceptions ! </p></li></ul></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13b"></a>6.9.1. Flushing the session</h3></div></div><p> ! If you happen to be using the <tt>Transaction</tt> API, you don't ! need to worry about this step. It will be performed implicitly when the ! transaction is committed. Otherwise you should call ! <tt>Session.flush()</tt> to ensure that all changes are synchronized ! with the database. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13b"></a>6.9.2. Committing the transaction</h3></div></div><p> ! If you are using the Hibernate <tt>Transaction</tt> API, this looks like: ! </p><pre class="programlisting">tx.commit(); // flush the Session and commit the transaction</pre><p> ! If you are managing JDBC transactions yourself you should manually ! <tt>commit()</tt> the JDBC connection. ! </p><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource</pre><p> ! If you decide <span class="emphasis"><em>not</em></span> to commit your changes: ! </p><pre class="programlisting">tx.rollback(); // rollback the transaction</pre><p> ! or: ! </p><pre class="programlisting">//not necessary for JTA datasource, important otherwise ! sess.connection().rollback();</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13c"></a>6.9.3. Closing the session</h3></div></div><p> ! A call to <tt>Session.close()</tt> marks the end of a session. The main implication ! of <tt>close()</tt> is that the JDBC connection will be relinquished by the session. ! </p><pre class="programlisting">tx.commit(); sess.close();</pre><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource sess.close();</pre><p> ! If you provided your own connection, <tt>close()</tt> returns a reference ! to it, so you can manually close it or return it to the pool. Otherwise <tt>close() ! </tt> returns it to the pool. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13d"></a>6.9.4. Exception handling</h3></div></div><p> ! If the <tt>Session</tt> throws an exception (including ! any <tt>SQLException</tt>), you should immediately ! rollback the transaction, call <tt>Session.close()</tt> ! and discard the <tt>Session</tt> instance. Certain ! methods of <tt>Session</tt> will <span class="emphasis"><em>not</em></span> ! leave the session in a consistent state. ! </p><p> ! The following exception handling idiom is recommended: ! </p><pre class="programlisting">Session sess = factory.openSession(); Transaction tx = null; try { --- 2400,2440 ---- </p></li><li><p> handle exceptions ! </p></li></ul></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-1"></a>6.9.1. Flushing the session</h3></div></div><p> ! If you happen to be using the <tt>Transaction</tt> API, you don't ! need to worry about this step. It will be performed implicitly when the ! transaction is committed. Otherwise you should call ! <tt>Session.flush()</tt> to ensure that all changes are synchronized ! with the database. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-2"></a>6.9.2. Committing the transaction</h3></div></div><p> ! If you are using the Hibernate <tt>Transaction</tt> API, this looks like: ! </p><pre class="programlisting">tx.commit(); // flush the Session and commit the transaction</pre><p> ! If you are managing JDBC transactions yourself you should manually ! <tt>commit()</tt> the JDBC connection. ! </p><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource</pre><p> ! If you decide <span class="emphasis"><em>not</em></span> to commit your changes: ! </p><pre class="programlisting">tx.rollback(); // rollback the transaction</pre><p> ! or: ! </p><pre class="programlisting">//not necessary for JTA datasource, important otherwise ! sess.connection().rollback();</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-3"></a>6.9.3. Closing the session</h3></div></div><p> ! A call to <tt>Session.close()</tt> marks the end of a session. The main implication ! of <tt>close()</tt> is that the JDBC connection will be relinquished by the session. ! </p><pre class="programlisting">tx.commit(); sess.close();</pre><pre class="programlisting">sess.flush(); sess.connection().commit(); //not necessary for JTA datasource sess.close();</pre><p> ! If you provided your own connection, <tt>close()</tt> returns a reference ! to it, so you can manually close it or return it to the pool. Otherwise <tt>close() ! </tt> returns it to the pool. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s13-4"></a>6.9.4. Exception handling</h3></div></div><p> ! If the <tt>Session</tt> throws an exception (including ! any <tt>SQLException</tt>), you should immediately ! rollback the transaction, call <tt>Session.close()</tt> ! and discard the <tt>Session</tt> instance. Certain ! methods of <tt>Session</tt> will <span class="emphasis"><em>not</em></span> ! leave the session in a consistent state. ! </p><p> ! The following exception handling idiom is recommended: ! </p><pre class="programlisting">Session sess = factory.openSession(); Transaction tx = null; try { *************** *** 2447,2452 **** sess.close(); }</pre><p> ! Or, when manually managing JDBC transactions: ! </p><pre class="programlisting">Session sess = factory.openSession(); try { //do some work --- 2451,2456 ---- sess.close(); }</pre><p> ! Or, when manually managing JDBC transactions: ! </p><pre class="programlisting">Session sess = factory.openSession(); try { //do some work *************** *** 2462,2467 **** sess.close(); }</pre><p> ! Or, when using a datasource enlisted with JTA: ! </p><pre class="programlisting">UserTransaction ut = .... ; Session sess = factory.openSession(); try { --- 2466,2471 ---- sess.close(); }</pre><p> ! Or, when using a datasource enlisted with JTA: ! </p><pre class="programlisting">UserTransaction ut = .... ; Session sess = factory.openSession(); try { *************** *** 2476,2489 **** finally { sess.close(); ! }</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s17"></a>6.10. Interceptors</h2></div></div><p> ! The <tt>Interceptor</tt> interface provides callbacks from the session to the ! application allowing the application to inspect and / or manipulate properties of a ! persistent object before it is saved, updated or deleted and after it is loaded. One ! possible use for this is to track auditing information. For example, the following ! <tt>Interceptor</tt> automatically sets the <tt>createTimestamp</tt> ! when an <tt>Auditable</tt> is created and updates the ! <tt>lastUpdateTimestamp</tt> property when an <tt>Auditable</tt> is ! updated. ! </p></div><pre class="programlisting">package cirrus.hibernate.test; import java.io.Serializable; --- 2480,2493 ---- finally { sess.close(); ! }</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s14"></a>6.10. Interceptors</h2></div></div><p> ! The <tt>Interceptor</tt> interface provides callbacks from the session to the ! application allowing the application to inspect and / or manipulate properties of a ! persistent object before it is saved, updated or deleted and after it is loaded. One ! possible use for this is to track auditing information. For example, the following ! <tt>Interceptor</tt> automatically sets the <tt>createTimestamp</tt> ! when an <tt>Auditable</tt> is created and updates the ! <tt>lastUpdateTimestamp</tt> property when an <tt>Auditable</tt> is ! updated. ! </p><pre class="programlisting">package cirrus.hibernate.test; import java.io.Serializable; *************** *** 2543,2548 **** }</pre><p> ! The interceptor would be specified when a session is created. ! </p><pre class="programlisting">Session session = sf.openSession( new AuditInterceptor() );</pre></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="query-language"></a>Chapter 7. Hibernate Query Language</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>7.1. <a href="#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="#query-language-s2">The from clause</a></dt><dt>7.3. <a href="#query-language-s3">The select clause</a></dt><dt>7.4. <a href="#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="#query-language-s4">from collections</a></dt><dt>7.6. <a href="#query-language-s5">The where clause</a></dt><dt>7.7. <a href="#query-language-s6">Expressions</a></dt><dt>7.8. <a href="#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="#query-language-s9">Subqueries</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="query-language-s1"></a>7.1. Case Sensitivity</h2></div></div><p> Queries are case-insensitive, except for names of Java classes and properties. So <tt>SeLeCT</tt> is the same as --- 2547,2552 ---- }</pre><p> ! The interceptor would be specified when a session is created. ! </p><pre class="programlisting">Session session = sf.openSession( new AuditInterceptor() );</pre></div></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="query-language"></a>Chapter 7. Hibernate Query Language</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>7.1. <a href="#query-language-s1">Case Sensitivity</a></dt><dt>7.2. <a href="#query-language-s2">The from clause</a></dt><dt>7.3. <a href="#query-language-s3">The select clause</a></dt><dt>7.4. <a href="#query-language-s3b">polymorphism</a></dt><dt>7.5. <a href="#query-language-s4">from collections</a></dt><dt>7.6. <a href="#query-language-s5">The where clause</a></dt><dt>7.7. <a href="#query-language-s6">Expressions</a></dt><dt>7.8. <a href="#query-language-s7">The order by clause</a></dt><dt>7.9. <a href="#query-language-s8">The group by clause</a></dt><dt>7.10. <a href="#query-language-s9">Subqueries</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="query-language-s1"></a>7.1. Case Sensitivity</h2></div></div><p> Queries are case-insensitive, except for names of Java classes and properties. So <tt>SeLeCT</tt> is the same as *************** *** 3159,3163 **** <id name="id" column="id"> ! <generator class="native"/> </id> --- 3163,3167 ---- <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> </id> |
From: <one...@us...> - 2002-11-21 09:03:49
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv679/cirrus/hibernate/type Modified Files: TypeFactory.java Log Message: calendar types Index: TypeFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TypeFactory.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TypeFactory.java 5 Nov 2002 11:48:08 -0000 1.21 --- TypeFactory.java 21 Nov 2002 09:03:14 -0000 1.22 *************** *** 6,9 **** --- 6,10 ---- import java.sql.Time; import java.sql.Timestamp; + import java.util.Calendar; import java.util.Collections; import java.util.Comparator; *************** *** 44,47 **** --- 45,50 ---- basics.put( Hibernate.TIMESTAMP.getName(), Hibernate.TIMESTAMP); basics.put( Hibernate.LOCALE.getName(), Hibernate.LOCALE); + basics.put( Hibernate.CALENDAR.getName(), Hibernate.CALENDAR); + basics.put( Hibernate.CALENDAR_DATE.getName(), Hibernate.CALENDAR_DATE); basics.put( Hibernate.CURRENCY.getName(), Hibernate.CURRENCY); basics.put( Hibernate.TIMEZONE.getName(), Hibernate.TIMEZONE); *************** *** 68,71 **** --- 71,75 ---- basics.put( BigDecimal.class.getName(), Hibernate.BIG_DECIMAL); basics.put( Locale.class.getName(), Hibernate.LOCALE); + basics.put( Calendar.class.getName(), Hibernate.CALENDAR); if ( CurrencyType.CURRENCY_CLASS!=null) basics.put( CurrencyType.CURRENCY_CLASS.getName(), Hibernate.CURRENCY); basics.put( TimeZone.class.getName(), Hibernate.TIMEZONE); |
From: <one...@us...> - 2002-11-21 09:03:47
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect In directory sc8-pr-cvs1:/tmp/cvs-serv679/cirrus/hibernate/tools/reflect Modified Files: ReflectedProperty.java Log Message: calendar types Index: ReflectedProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/ReflectedProperty.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ReflectedProperty.java 11 Nov 2002 01:25:07 -0000 1.15 --- ReflectedProperty.java 21 Nov 2002 09:03:14 -0000 1.16 *************** *** 4,7 **** --- 4,8 ---- import java.sql.Time; import java.sql.Timestamp; + import java.util.Calendar; import java.util.HashMap; import java.util.Locale; *************** *** 41,44 **** --- 42,46 ---- shortTypeNames.put( String.class.getName(), Hibernate.STRING.getName() ); shortTypeNames.put( Locale.class.getName(), Hibernate.LOCALE.getName() ); + shortTypeNames.put( Calendar.class.getName(), Hibernate.CALENDAR.getName() ); if ( CurrencyType.CURRENCY_CLASS!=null) shortTypeNames.put( CurrencyType.CURRENCY_CLASS.getName(), Hibernate.CURRENCY.getName() ); shortTypeNames.put( TimeZone.class.getName(), Hibernate.TIMEZONE.getName() ); |
From: <one...@us...> - 2002-11-21 09:03:47
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv679/cirrus/hibernate/impl Modified Files: QueryImpl.java ScrollableResultsImpl.java Log Message: calendar types Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/QueryImpl.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** QueryImpl.java 28 Oct 2002 13:44:49 -0000 1.18 --- QueryImpl.java 21 Nov 2002 09:03:11 -0000 1.19 *************** *** 7,10 **** --- 7,11 ---- import java.sql.SQLException; import java.util.ArrayList; + import java.util.Calendar; import java.util.Collection; import java.util.Date; *************** *** 228,231 **** --- 229,239 ---- } + public void setCalendar(int position, Calendar calendar) { + setParameter(position, calendar, Hibernate.CALENDAR); + } + + public void setCalendarDate(int position, Calendar calendar) { + setParameter(position, calendar, Hibernate.CALENDAR_DATE); + } /* * @see Query#setBinary(String, byte[]) *************** *** 303,306 **** --- 311,322 ---- public void setLocale(String name, Locale locale) { setParameter(name, locale, Hibernate.LOCALE); + } + + public void setCalendar(String name, Calendar calendar) { + setParameter(name, calendar, Hibernate.CALENDAR); + } + + public void setCalendarDate(String name, Calendar calendar) { + setParameter(name, calendar, Hibernate.CALENDAR_DATE); } Index: ScrollableResultsImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/ScrollableResultsImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScrollableResultsImpl.java 24 Oct 2002 05:45:21 -0000 1.5 --- ScrollableResultsImpl.java 21 Nov 2002 09:03:12 -0000 1.6 *************** *** 5,8 **** --- 5,9 ---- import java.sql.ResultSet; import java.sql.SQLException; + import java.util.Calendar; import java.util.Date; import java.util.Locale; *************** *** 137,140 **** --- 138,145 ---- public Date getDate(int col) throws SQLException, HibernateException { return (Date) get(col); + } + + public Calendar getCalendar(int col) throws SQLException, HibernateException { + return (Calendar) get(col); } |
From: <one...@us...> - 2002-11-21 09:03:46
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv679/cirrus/hibernate Modified Files: Hibernate.java Query.java ScrollableResults.java Log Message: calendar types Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Hibernate.java 31 Oct 2002 15:09:49 -0000 1.61 --- Hibernate.java 21 Nov 2002 09:03:07 -0000 1.62 *************** *** 88,91 **** --- 88,99 ---- public static final NullableType BINARY = new BinaryType(); /** + * Hibernate <tt>calendar</tt> type + */ + public static final NullableType CALENDAR = new CalendarType(); + /** + * Hibernate <tt>calendar_date</tt> type + */ + public static final NullableType CALENDAR_DATE = new CalendarDateType(); + /** * Hibernate <tt>locale</tt> type */ Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Query.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Query.java 28 Oct 2002 13:44:49 -0000 1.14 --- Query.java 21 Nov 2002 09:03:09 -0000 1.15 *************** *** 5,8 **** --- 5,9 ---- import java.math.BigDecimal; import java.sql.SQLException; + import java.util.Calendar; import java.util.Collection; import java.util.Date; *************** *** 182,185 **** --- 183,189 ---- public void setTimestamp(int position, Date date); + public void setCalendar(int position, Calendar calendar); + public void setCalendarDate(int position, Calendar calendar); + public void setString(String name, String val); public void setCharacter(String name, char val); *************** *** 199,202 **** --- 203,209 ---- public void setTime(String name, Date date); public void setTimestamp(String name, Date date); + + public void setCalendar(String name, Calendar calendar); + public void setCalendarDate(String name, Calendar calendar); /** Index: ScrollableResults.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/ScrollableResults.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScrollableResults.java 24 Oct 2002 05:45:21 -0000 1.4 --- ScrollableResults.java 21 Nov 2002 09:03:09 -0000 1.5 *************** *** 4,7 **** --- 4,8 ---- import java.math.BigDecimal; import java.sql.SQLException; + import java.util.Calendar; import java.util.Date; import java.util.Locale; *************** *** 138,141 **** --- 139,146 ---- */ public Locale getLocale(int col) throws SQLException, HibernateException; + /** + * Convenience method to read a calendar or calendar date + */ + public Calendar getCalendar(int col) throws SQLException, HibernateException; /** * Convenience method to read a currency |
From: <one...@us...> - 2002-11-21 09:03:35
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv679/doc/reference/src Modified Files: basic_or_mapping.xml examples.xml Log Message: calendar types Index: basic_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/basic_or_mapping.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** basic_or_mapping.xml 19 Nov 2002 10:42:18 -0000 1.35 --- basic_or_mapping.xml 21 Nov 2002 09:03:30 -0000 1.36 *************** *** 1071,1077 **** <listitem> <para> ! Type mappings from <literal>java.util.Date</literal> and its subclasses to ! SQL types <literal>DATE</literal>, <literal>TIME</literal> and <literal>TIMESTAMP</literal> (or equivalent). </para> </listitem> --- 1071,1087 ---- <listitem> <para> ! Type mappings from <literal>java.util.Date</literal> and its subclasses ! to SQL types <literal>DATE</literal>, <literal>TIME</literal> and <literal>TIMESTAMP</literal> (or equivalent). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>calendar, calendar_date</literal></term> + <listitem> + <para> + Type mappings from <literal>java.util.Calendar</literal> to + SQL types <literal>TIMESTAMP</literal> and <literal>DATE</literal> + (or equivalent). </para> </listitem> Index: examples.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/examples.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** examples.xml 28 Oct 2002 08:50:20 -0000 1.3 --- examples.xml 21 Nov 2002 09:03:31 -0000 1.4 *************** *** 162,166 **** <id name="id" column="id"> ! <generator class="native"/> </id> --- 162,166 ---- <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> </id> |
From: <one...@us...> - 2002-11-21 08:08:36
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv20726/cirrus/hibernate/persister Modified Files: MultiTableEntityPersister.java Log Message: fixed a problem with identity columns in DB2 with normalized table mapping Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MultiTableEntityPersister.java 20 Nov 2002 10:30:45 -0000 1.31 --- MultiTableEntityPersister.java 21 Nov 2002 08:08:33 -0000 1.32 *************** *** 346,350 **** .append( StringHelper.repeat( "?, ", count ) ); ! if (insertIdentifierColumns) { buf.append( StringHelper.repeat( "?, ", identifierColumnNames.length-1 ) ) .append("?"); --- 346,353 ---- .append( StringHelper.repeat( "?, ", count ) ); ! if ( j==0 && identityColumnInsertString!=null ) { ! buf.append(identityColumnInsertString); ! } ! else if (insertIdentifierColumns) { buf.append( StringHelper.repeat( "?, ", identifierColumnNames.length-1 ) ) .append("?"); *************** *** 640,644 **** PreparedStatement statement = session.getBatcher().prepareStatement( sql[0] ); - try { dehydrate(null, fields, 0, statement, session); --- 643,646 ---- |