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-02 15:33:46
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen
In directory usw-pr-cvs1:/tmp/cvs-serv19743
Modified Files:
BasicRenderer.java
Log Message:
integrated patch by Max Andersen fixing bug when no properties
Index: BasicRenderer.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/BasicRenderer.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** BasicRenderer.java 29 Oct 2002 16:09:05 -0000 1.10
--- BasicRenderer.java 2 Nov 2002 15:33:42 -0000 1.11
***************
*** 80,89 ****
writer.println();
- // no args constructor
- writer.println(" public " + classMapping.getName() + "() {" );
- writer.println(" }");
- writer.println();
-
// full constructor
String fullCons = " public " + classMapping.getName() + "(";
for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
--- 80,85 ----
writer.println();
// full constructor
+ int fullConsArgCount = 0;
String fullCons = " public " + classMapping.getName() + "(";
for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
***************
*** 91,100 ****
if(!field.isIdentifier() || (field.isIdentifier() && !field.isGenerated())) {
fullCons = fullCons + field.getType() + " " + field.getName();
! fullCons = fullCons + ", ";
}
}
! // may use fields.hasNext() in the loop to prevent this String trick,
! // but I cannot avoid it in the minimal constructor
! fullCons = fullCons.substring(0, fullCons.length() - 2);
writer.println(fullCons + ") {");
for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
--- 87,99 ----
if(!field.isIdentifier() || (field.isIdentifier() && !field.isGenerated())) {
fullCons = fullCons + field.getType() + " " + field.getName();
! if(fields.hasNext()) {
! fullCons = fullCons + ", ";
! fullConsArgCount++;
! }
}
}
! if(fullConsArgCount>0) { // only remove the last , and space if there was an arg!
! fullCons = fullCons.substring(0, fullCons.length() - 2);
! }
writer.println(fullCons + ") {");
for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
***************
*** 106,111 ****
writer.println(" }");
writer.println();
- // minimal constructor
if(classMapping.needsMinimalConstructor()) {
String minCons = " public " + classMapping.getName() + "(";
--- 105,119 ----
writer.println(" }");
writer.println();
+
+ // no args constructor (if fullconstructor had any arguments!)
+ if (fullConsArgCount > 0) {
+ writer.println(" public " + classMapping.getName() + "() {");
+ writer.println(" }");
+ writer.println();
+ }
+
+ // minimal constructor (only if the fullconstructor had any arguments)
+ if(fullConsArgCount>0) {
if(classMapping.needsMinimalConstructor()) {
String minCons = " public " + classMapping.getName() + "(";
***************
*** 130,134 ****
writer.println();
}
!
// field accessors
--- 138,142 ----
writer.println();
}
! }
// field accessors
|
|
From: <one...@us...> - 2002-11-02 14:32:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory usw-pr-cvs1:/tmp/cvs-serv14303/cirrus/hibernate/test
Modified Files:
Qux.java
Log Message:
several minor changes
Index: Qux.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Qux.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Qux.java 22 Oct 2002 11:53:32 -0000 1.11
--- Qux.java 2 Nov 2002 14:32:13 -0000 1.12
***************
*** 27,31 ****
private FooProxy foo;
! Qux() { }
public Qux(String s) {
--- 27,31 ----
private FooProxy foo;
! public Qux() { }
public Qux(String s) {
|
|
From: <one...@us...> - 2002-11-02 14:32:16
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql
In directory usw-pr-cvs1:/tmp/cvs-serv14303/cirrus/hibernate/sql
Modified Files:
Dialect.java
Log Message:
several minor changes
Index: Dialect.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/Dialect.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Dialect.java 31 Oct 2002 15:17:41 -0000 1.39
--- Dialect.java 2 Nov 2002 14:32:13 -0000 1.40
***************
*** 17,21 ****
import cirrus.hibernate.loader.OuterJoinGenerator;
import cirrus.hibernate.loader.AnsiOuterJoinGenerator;
- import cirrus.hibernate.type.Type;
/**
--- 17,20 ----
***************
*** 316,322 ****
}
- public Type overrideIdentifierType(Type type) {
- return type;
- }
}
--- 315,318 ----
|
|
From: <one...@us...> - 2002-11-02 14:32:16
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers
In directory usw-pr-cvs1:/tmp/cvs-serv14303/cirrus/hibernate/helpers
Modified Files:
PropertiesHelper.java
Log Message:
several minor changes
Index: PropertiesHelper.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/PropertiesHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PropertiesHelper.java 26 Oct 2002 06:35:17 -0000 1.1
--- PropertiesHelper.java 2 Nov 2002 14:32:12 -0000 1.2
***************
*** 47,55 ****
public static String[] toStringArray(String propValue, String delim) {
if (propValue!=null) {
! StringTokenizer tokens = new StringTokenizer(propValue, delim);
! String[] array = new String[ tokens.countTokens() ];
! int i=0;
! while ( tokens.hasMoreTokens() ) array[i++] = tokens.nextToken();
! return array;
}
else {
--- 47,51 ----
public static String[] toStringArray(String propValue, String delim) {
if (propValue!=null) {
! return StringHelper.split(delim, propValue);
}
else {
|
|
From: <one...@us...> - 2002-11-02 14:32:16
|
Update of /cvsroot/hibernate/Hibernate In directory usw-pr-cvs1:/tmp/cvs-serv14303 Modified Files: changelog.txt hibernate.properties Log Message: several minor changes Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.254 retrieving revision 1.255 diff -C2 -d -r1.254 -r1.255 *** changelog.txt 31 Oct 2002 15:09:51 -0000 1.254 --- changelog.txt 2 Nov 2002 14:32:11 -0000 1.255 *************** *** 1,4 **** --- 1,5 ---- Hibernate Changelog =================== + Changes in version 1.1.9 (x.11.2002) ------------------------------------ Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate/hibernate.properties,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** hibernate.properties 30 Oct 2002 15:28:04 -0000 1.86 --- hibernate.properties 2 Nov 2002 14:32:12 -0000 1.87 *************** *** 1,5 **** ! ######################## ! ### Queries Language ### ! ######################## ## define query language constants / function names --- 1,5 ---- ! ###################### ! ### Query Language ### ! ###################### ## define query language constants / function names |
|
From: <one...@us...> - 2002-11-02 14:32:16
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy In directory usw-pr-cvs1:/tmp/cvs-serv14303/cirrus/hibernate/proxy Modified Files: CGLIBLazyInitializer.java HibernateProxyHelper.java Log Message: several minor changes Index: CGLIBLazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy/CGLIBLazyInitializer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CGLIBLazyInitializer.java 28 Oct 2002 19:27:48 -0000 1.3 --- CGLIBLazyInitializer.java 2 Nov 2002 14:32:13 -0000 1.4 *************** *** 5,13 **** import java.lang.reflect.Method; - import cirrus.hibernate.HibernateException; - import cirrus.hibernate.cglib.Enhancer; - import cirrus.hibernate.cglib.MethodInterceptor; import cirrus.hibernate.engine.SessionImplementor; /** --- 5,13 ---- import java.lang.reflect.Method; import cirrus.hibernate.HibernateException; import cirrus.hibernate.engine.SessionImplementor; + + import net.sf.cglib.proxy.Enhancer; + import net.sf.cglib.proxy.MethodInterceptor; /** Index: HibernateProxyHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy/HibernateProxyHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HibernateProxyHelper.java 29 Oct 2002 07:50:41 -0000 1.4 --- HibernateProxyHelper.java 2 Nov 2002 14:32:13 -0000 1.5 *************** *** 4,9 **** import java.sql.SQLException; import cirrus.hibernate.HibernateException; - import cirrus.hibernate.cglib.Enhancer; import cirrus.hibernate.engine.SessionImplementor; --- 4,10 ---- import java.sql.SQLException; + import net.sf.cglib.proxy.Enhancer; + import cirrus.hibernate.HibernateException; import cirrus.hibernate.engine.SessionImplementor; |
|
From: <one...@us...> - 2002-11-02 14:32:16
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory usw-pr-cvs1:/tmp/cvs-serv14303/cirrus/hibernate/impl Modified Files: SessionImpl.java Log Message: several minor changes Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** SessionImpl.java 31 Oct 2002 16:58:14 -0000 1.145 --- SessionImpl.java 2 Nov 2002 14:32:12 -0000 1.146 *************** *** 14,17 **** --- 14,18 ---- import java.sql.Connection; import java.util.Collection; + import java.util.Collections; import java.util.Iterator; import java.util.ArrayList; *************** *** 1055,1058 **** --- 1056,1061 ---- QueryTranslator[] q = getQueries(query, false); + + if (q.length==0) return Collections.EMPTY_LIST; List result = null; |
|
From: <one...@us...> - 2002-11-01 00:21:32
|
Update of /cvsroot/hibernate/Hibernate
In directory usw-pr-cvs1:/tmp/cvs-serv10134
Modified Files:
build.xml
Log Message:
added bin directory to build
Index: build.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/build.xml,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** build.xml 15 Oct 2002 13:03:56 -0000 1.28
--- build.xml 1 Nov 2002 00:21:26 -0000 1.29
***************
*** 190,193 ****
--- 190,198 ----
<target name="extras" description="Copies miscellaneous files to root dir">
+ <copy todir="${dist.dir}/bin">
+ <fileset dir="${src.dir}/bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
<copy file="hibernate.properties" todir="${dist.dir}"/>
<copy file="log4j.properties" todir="${dist.dir}"/>
|
|
From: <one...@us...> - 2002-11-01 00:11:38
|
Update of /cvsroot/hibernate/Hibernate/bin In directory usw-pr-cvs1:/tmp/cvs-serv7394 Modified Files: CodeGenerator.bat Log Message: fixed default HIBERNATE_HOME Index: CodeGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate/bin/CodeGenerator.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeGenerator.bat 31 Oct 2002 17:38:49 -0000 1.1 --- CodeGenerator.bat 1 Nov 2002 00:11:32 -0000 1.2 *************** *** 6,10 **** set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip ! set HIBERNATE_HOME=C:\Hibernate 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%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar --- 6,10 ---- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip ! 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%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar |
|
From: <one...@us...> - 2002-10-31 17:38:57
|
Update of /cvsroot/hibernate/Hibernate/bin In directory usw-pr-cvs1:/tmp/cvs-serv8726/bin Added Files: CodeGenerator.bat MapGenerator.bat SchemaExport.bat Log Message: scr1pts for running the tools --- NEW FILE: CodeGenerator.bat --- @echo off rem ------------------------------------------------------------------- rem Execute CodeGenerator tool rem ------------------------------------------------------------------- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip set HIBERNATE_HOME=C:\Hibernate 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%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.CodeGenerator %* --- NEW FILE: MapGenerator.bat --- @echo off rem ------------------------------------------------------------------- rem Execute MapGenerator tool rem ------------------------------------------------------------------- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip 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%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp CP cirrus.hibernate.tools.MapGenerator %* --- NEW FILE: SchemaExport.bat --- @echo off rem ------------------------------------------------------------------- rem Execute SchemaExport tool rem ------------------------------------------------------------------- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip 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%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.SchemaExport %* |
|
From: <one...@us...> - 2002-10-31 17:37:54
|
Update of /cvsroot/hibernate/Hibernate/bin In directory usw-pr-cvs1:/tmp/cvs-serv8137a/bin Log Message: Directory /cvsroot/hibernate/Hibernate/bin added to the repository |
|
From: <one...@us...> - 2002-10-31 16:58:51
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory usw-pr-cvs1:/tmp/cvs-serv13818/cirrus/hibernate/impl
Modified Files:
SessionImpl.java
Added Files:
BatcherImpl.java BatchingBatcher.java NonBatchingBatcher.java
Log Message:
Batcher hierarchy enforces seperation of concerns
--- NEW FILE: BatcherImpl.java ---
//$Id: BatcherImpl.java,v 1.1 2002/10/31 16:58:13 oneovthafew Exp $
package cirrus.hibernate.impl;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Iterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.engine.Batcher;
import cirrus.hibernate.engine.SessionFactoryImplementor;
import cirrus.hibernate.engine.SessionImplementor;
/**
* Manages prepared statements and batching. Class exists to enforce seperation of concerns.
*/
public abstract class BatcherImpl implements Batcher {
protected static final Log log = LogFactory.getLog(BatcherImpl.class);
protected final SessionImplementor session;
protected final SessionFactoryImplementor factory;
private PreparedStatement batchUpdate;
private String batchUpdateSQL;
private HashSet statementsToClose = new HashSet();
public BatcherImpl(SessionImplementor session) {
this.session = session;
this.factory = session.getFactory();
}
protected PreparedStatement getStatement() {
return batchUpdate;
}
public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException {
executeBatch();
return factory.getPreparedStatement( session.connection(), sql, false );
}
public PreparedStatement prepareQueryStatement(String sql, boolean scrollable) throws SQLException, HibernateException {
PreparedStatement ps = factory.getPreparedStatement( session.connection(), sql, scrollable );
factory.setFetchSize(ps);
statementsToClose.add(ps);
return ps;
}
public void closeQueryStatement(PreparedStatement ps) throws SQLException {
statementsToClose.remove(ps);
factory.closePreparedStatement(ps);
}
public void closeStatement(PreparedStatement ps) throws SQLException {
factory.closePreparedStatement(ps);
}
public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException {
if ( !sql.equals(batchUpdateSQL) ) {
batchUpdate=prepareStatement(sql); // calls executeBatch()
batchUpdateSQL=sql;
}
return batchUpdate;
}
public void executeBatch() throws SQLException, HibernateException {
if (batchUpdate!=null) {
final PreparedStatement ps = batchUpdate;
batchUpdate=null;
batchUpdateSQL=null;
try {
doExecuteBatch(ps);
}
finally {
closeStatement(ps);
}
}
}
public void closeStatements() {
Iterator iter = statementsToClose.iterator();
while ( iter.hasNext() ) {
try {
closeStatement( (PreparedStatement) iter.next() );
}
catch (SQLException e) {
// no big deal
log.warn("Could not close a JDBC statement", e);
}
iter.remove();
}
statementsToClose.clear();
}
protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException;
}
--- NEW FILE: BatchingBatcher.java ---
//$Id: BatchingBatcher.java,v 1.1 2002/10/31 16:58:14 oneovthafew Exp $
package cirrus.hibernate.impl;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.engine.SessionImplementor;
import cirrus.hibernate.helpers.JDBCExceptionReporter;
/**
* An implementation of the <tt>Batcher</tt> interface that actually uses batching
*/
public class BatchingBatcher extends BatcherImpl {
private int batchSize;
public BatchingBatcher(SessionImplementor session) {
super(session);
}
public void addToBatch(int expectedRowCount) throws SQLException, HibernateException {
log.trace("Adding to batch");
PreparedStatement batchUpdate = getStatement();
batchUpdate.addBatch();
batchSize++;
if ( batchSize==factory.getJdbcBatchSize() ) {
try {
doExecuteBatch(batchUpdate);
}
catch (SQLException sqle) {
closeStatement(batchUpdate);
throw sqle;
}
catch (HibernateException he) {
closeStatement(batchUpdate);
throw he;
}
}
}
protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException {
if ( log.isDebugEnabled() )
log.debug("Executing batch size: " + batchSize );
try {
if (batchSize!=0) {
final int[] results = ps.executeBatch();
// check return codes
for ( int i=0; i<batchSize; i++ ) {
if ( results[i]==-3 ) throw new HibernateException("Batch update failed");
}
}
}
catch(SQLException sqle) {
JDBCExceptionReporter.logExceptions(sqle);
throw sqle;
}
catch(RuntimeException re) {
log.error("Exception executing batch: ", re);
throw re;
}
finally {
batchSize=0;
//ps.clearBatch();
}
}
}
--- NEW FILE: NonBatchingBatcher.java ---
//$Id: NonBatchingBatcher.java,v 1.1 2002/10/31 16:58:14 oneovthafew Exp $
package cirrus.hibernate.impl;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.engine.SessionImplementor;
/**
* An implementation of the <tt>Batcher</tt> interface that does no batching
*/
public class NonBatchingBatcher extends BatcherImpl {
public NonBatchingBatcher(SessionImplementor session) {
super(session);
}
public void addToBatch(int expectedRowCount) throws SQLException, HibernateException {
int rowCount = getStatement().executeUpdate();
//negative expected row count means we don't know how many rows to expect
if ( expectedRowCount>0 && expectedRowCount!=rowCount )
throw new HibernateException("SQL update or deletion failed (row not found)");
}
protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException {
}
}
Index: SessionImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v
retrieving revision 1.144
retrieving revision 1.145
diff -C2 -d -r1.144 -r1.145
*** SessionImpl.java 29 Oct 2002 07:50:40 -0000 1.144
--- SessionImpl.java 31 Oct 2002 16:58:14 -0000 1.145
***************
*** 13,17 ****
import java.sql.SQLException;
import java.sql.Connection;
- import java.sql.PreparedStatement;
import java.util.Collection;
import java.util.Iterator;
--- 13,16 ----
***************
*** 65,69 ****
* NOT THREADSAFE
*/
! public final class SessionImpl implements SessionImplementor, Batcher {
private static final Log log = LogFactory.getLog(SessionImpl.class);
--- 64,68 ----
* NOT THREADSAFE
*/
! public final class SessionImpl implements SessionImplementor {
private static final Log log = LogFactory.getLog(SessionImpl.class);
***************
*** 92,96 ****
private transient Connection connection;
private transient boolean connect;
- private transient HashSet statementsToClose;
// We keep scheduled insertions, deletions and updates in collections
--- 91,94 ----
***************
*** 121,124 ****
--- 119,124 ----
private transient int dontFlushFromFind = 0;
private transient boolean reentrantCallback = false;
+
+ private transient Batcher batcher;
static final class Status implements Serializable {
***************
*** 335,339 ****
public Batcher getBatcher() {
! return this;
}
--- 335,343 ----
public Batcher getBatcher() {
! if (batcher==null) batcher = factory.useJdbcBatch() ?
! (Batcher) new BatchingBatcher(this) :
! (Batcher) new NonBatchingBatcher(this);
!
! return batcher;
}
***************
*** 388,408 ****
}
- private void closeStatements() {
- Iterator iter = statementsToClose.iterator();
- while ( iter.hasNext() ) {
- try {
- closeStatement( (PreparedStatement) iter.next() );
- }
- catch (SQLException e) {
- // no big deal
- log.warn("Could not close a JDBC statement", e);
- }
- iter.remove();
- }
- statementsToClose.clear();
- }
-
private void initTransientCollections() {
- statementsToClose = new HashSet();
insertions = new ArrayList(20);
deletions = new ArrayList(20);
--- 392,396 ----
***************
*** 734,743 ****
);
-
- }
-
-
- private static Integer increment(Integer integer) {
- return new Integer( integer.intValue() + 1 );
}
--- 722,725 ----
***************
*** 1719,1723 ****
iter.remove();
}
! executeBatch();
}
--- 1701,1705 ----
iter.remove();
}
! if ( batcher!=null ) batcher.executeBatch();
}
***************
*** 2389,2493 ****
}
- // Connections and Prepared Statements ///////////////////////////////////////////////////
-
- public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException {
- executeBatch();
- return factory.getPreparedStatement( connection(), sql, false );
- }
- public PreparedStatement prepareQueryStatement(String sql, boolean scrollable) throws SQLException, HibernateException {
- PreparedStatement ps = factory.getPreparedStatement( connection(), sql, scrollable );
- factory.setFetchSize(ps);
- statementsToClose.add(ps);
- return ps;
- }
-
- public void closeQueryStatement(PreparedStatement ps) throws SQLException {
- statementsToClose.remove(ps);
- factory.closePreparedStatement(ps);
- }
-
- public void closeStatement(PreparedStatement ps) throws SQLException {
- factory.closePreparedStatement(ps);
- }
-
- private transient PreparedStatement batchUpdate;
- private transient String batchUpdateSQL;
- private transient int batchSize;
-
- public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException {
- if ( !sql.equals(batchUpdateSQL) ) {
- batchUpdate=prepareStatement(sql); // calls executeBatch()
- batchUpdateSQL=sql;
- }
- return batchUpdate;
- }
-
- public void addToBatch(int expectedRowCount) throws SQLException, HibernateException {
- if ( !factory.useJdbcBatch() ) { //ie. not using batches
- int rowCount = batchUpdate.executeUpdate();
- if (expectedRowCount>0 && expectedRowCount!=rowCount) throw new HibernateException("SQL update or deletion failed (row not found)");
- }
- else {
- log.trace("Adding to batch");
- batchUpdate.addBatch();
- batchSize++;
- if ( batchSize==factory.getJdbcBatchSize() ) {
- try {
- doExecuteBatch(batchUpdate);
- }
- catch (SQLException sqle) {
- closeStatement(batchUpdate);
- throw sqle;
- }
- catch (HibernateException he) {
- closeStatement(batchUpdate);
- throw he;
- }
- }
- }
- }
-
- private void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException {
- if ( log.isDebugEnabled() )
- log.debug("Executing batch size: " + batchSize );
-
- try {
- if (batchSize!=0) {
- final int[] results = ps.executeBatch();
- // check return codes
- for ( int i=0; i<batchSize; i++ ) {
- if ( results[i]==-3 ) throw new HibernateException("Batch update failed");
- }
- }
- }
- catch(SQLException sqle) {
- JDBCExceptionReporter.logExceptions(sqle);
- throw sqle;
- }
- catch(RuntimeException re) {
- log.error("Exception executing batch: ", re);
- throw re;
- }
- finally {
- batchSize=0;
- //ps.clearBatch();
- }
- }
-
-
- public void executeBatch() throws SQLException, HibernateException {
- if (batchUpdate!=null) {
- final PreparedStatement ps = batchUpdate;
- batchUpdate=null;
- batchUpdateSQL=null;
- try {
- if ( factory.useJdbcBatch() ) doExecuteBatch(ps);
- }
- finally {
- closeStatement(ps);
- }
- }
- }
-
public Connection connection() throws HibernateException, SQLException {
if (connection==null) {
--- 2371,2374 ----
***************
*** 2521,2525 ****
if (connection==null) throw new HibernateException("Session already disconnected");
! closeStatements();
Connection c = connection;
connection=null;
--- 2402,2406 ----
if (connection==null) throw new HibernateException("Session already disconnected");
! if (batcher!=null) batcher.closeStatements();
Connection c = connection;
connection=null;
|
|
From: <one...@us...> - 2002-10-31 16:58:28
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine In directory usw-pr-cvs1:/tmp/cvs-serv13818/cirrus/hibernate/engine Modified Files: Batcher.java SessionFactoryImplementor.java Log Message: Batcher hierarchy enforces seperation of concerns Index: Batcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine/Batcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Batcher.java 24 Oct 2002 10:04:28 -0000 1.2 --- Batcher.java 31 Oct 2002 16:58:16 -0000 1.3 *************** *** 54,57 **** --- 54,62 ---- */ public void executeBatch() throws SQLException, HibernateException; + + /** + * Close any query statements that were left lying around + */ + public void closeStatements(); } Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionFactoryImplementor.java 18 Oct 2002 15:50:08 -0000 1.3 --- SessionFactoryImplementor.java 31 Oct 2002 16:58:20 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- import java.sql.Connection; + import java.sql.PreparedStatement; import java.sql.SQLException; *************** *** 69,71 **** --- 70,92 ---- */ public String[] getImports(); + + /** + * Dispose of a prepared statement + */ + public void closePreparedStatement(PreparedStatement ps) throws SQLException; + + /** + * Obtain a prepared statement + */ + public PreparedStatement getPreparedStatement(final Connection conn, final String sql, boolean scrollable) throws SQLException; + + /** + * Get the JDBC batch size + */ + public int getJdbcBatchSize(); + + /** + * Set the fetch size + */ + public void setFetchSize(PreparedStatement statement) throws SQLException; } |
|
From: <one...@us...> - 2002-10-31 15:17:47
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql
In directory usw-pr-cvs1:/tmp/cvs-serv13327/cirrus/hibernate/sql
Modified Files:
Dialect.java
Log Message:
removed unused imports
Index: Dialect.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/Dialect.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Dialect.java 31 Oct 2002 14:00:24 -0000 1.38
--- Dialect.java 31 Oct 2002 15:17:41 -0000 1.39
***************
*** 2,13 ****
package cirrus.hibernate.sql;
- import java.io.InputStream;
import java.io.Serializable;
- import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.Map;
import java.util.Properties;
--- 2,8 ----
***************
*** 15,19 ****
import org.apache.commons.logging.LogFactory;
- import cirrus.hibernate.helpers.PropertiesHelper;
import cirrus.hibernate.helpers.ReflectHelper;
import cirrus.hibernate.helpers.StringHelper;
--- 10,13 ----
***************
*** 23,26 ****
--- 17,21 ----
import cirrus.hibernate.loader.OuterJoinGenerator;
import cirrus.hibernate.loader.AnsiOuterJoinGenerator;
+ import cirrus.hibernate.type.Type;
/**
***************
*** 48,59 ****
}
! private final TypeNames typeNames = new TypeNames("$l");
! private final Properties properties = new Properties();
! private final OuterJoinGenerator outerJoinGenerator = new AnsiOuterJoinGenerator();
public static final String QUOTE="`\"";
-
/**
* Get the name of the database type associated with the given
--- 43,56 ----
}
! private final TypeNames typeNames = new TypeNames("$l");
! private final Properties properties = new Properties();
! private final OuterJoinGenerator outerJoinGenerator = new AnsiOuterJoinGenerator();
+ /**
+ * Characters used for quoting SQL identifiers
+ */
public static final String QUOTE="`\"";
/**
* Get the name of the database type associated with the given
***************
*** 317,320 ****
--- 314,321 ----
public OuterJoinGenerator getOuterJoinGenerator() {
return outerJoinGenerator;
+ }
+
+ public Type overrideIdentifierType(Type type) {
+ return type;
}
}
|
|
From: <one...@us...> - 2002-10-31 15:11:01
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy
In directory usw-pr-cvs1:/tmp/cvs-serv9429/cirrus/hibernate/proxy
Modified Files:
LazyInitializer.java
Log Message:
Hibernate.initialize()
Index: LazyInitializer.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy/LazyInitializer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** LazyInitializer.java 29 Oct 2002 16:09:05 -0000 1.8
--- LazyInitializer.java 31 Oct 2002 15:10:57 -0000 1.9
***************
*** 64,87 ****
overridesEquals = ReflectHelper.overridesEquals(persistentClass);
}
!
! private void initialize() throws HibernateException, SQLException {
if (target==null) {
if ( session==null ) {
! throw new LazyInitializationException(
! "Could not initialize proxy - no Session"
! );
}
else if ( !session.isOpen() ) {
! throw new LazyInitializationException(
! "Could not initialize proxy - the owning Session was closed"
! );
}
! try {
target = session.immediateLoad(persistentClass, id);
}
! catch (Exception e) {
! LogFactory.getLog(LazyInitializer.class).error("Exception initializing proxy", e);
! throw new LazyInitializationException(e);
! }
}
}
--- 64,89 ----
overridesEquals = ReflectHelper.overridesEquals(persistentClass);
}
!
! public void initialize() throws HibernateException, SQLException {
if (target==null) {
if ( session==null ) {
! throw new HibernateException("Could not initialize proxy - no Session");
}
else if ( !session.isOpen() ) {
! throw new HibernateException("Could not initialize proxy - the owning Session was closed");
}
! else {
target = session.immediateLoad(persistentClass, id);
}
! }
! }
!
! private void initializeWrapExceptions() {
! try {
! initialize();
! }
! catch (Exception e) {
! LogFactory.getLog(LazyInitializer.class).error("Exception initializing proxy", e);
! throw new LazyInitializationException(e);
}
}
***************
*** 162,166 ****
*/
public final Object getImplementation() throws HibernateException, SQLException {
! initialize();
return target;
}
--- 164,168 ----
*/
public final Object getImplementation() throws HibernateException, SQLException {
! initializeWrapExceptions();
return target;
}
|
|
From: <one...@us...> - 2002-10-31 15:10:27
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate
In directory usw-pr-cvs1:/tmp/cvs-serv8698/cirrus/hibernate
Modified Files:
Hibernate.java
Log Message:
cirrus/hibernate/proxy/LazyInitializer.java
Index: Hibernate.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Hibernate.java,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** Hibernate.java 30 Oct 2002 15:42:31 -0000 1.60
--- Hibernate.java 31 Oct 2002 15:09:49 -0000 1.61
***************
*** 2,9 ****
--- 2,13 ----
package cirrus.hibernate;
+ import cirrus.hibernate.proxy.HibernateProxy;
+ import cirrus.hibernate.proxy.HibernateProxyHelper;
import cirrus.hibernate.type.*;
import java.io.Serializable;
+ import java.sql.SQLException;
import cirrus.hibernate.cfg.Configuration;
+ import cirrus.hibernate.collections.PersistentCollection;
import cirrus.hibernate.impl.DatastoreImpl;
import cirrus.hibernate.impl.SessionFactoryObjectFactory;
***************
*** 161,164 ****
--- 165,186 ----
configured = true;
}
+ }
+ }
+
+ /**
+ * Force initialization of a proxy or persistent collection.
+ * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt>
+ * @throws HibernateException if we can't initialize the proxy at this time, eg. the <tt>Session</tt> was closed
+ * @throws SQLException
+ */
+ public static void initialize(Object proxy) throws HibernateException, SQLException {
+ if (proxy==null) {
+ return;
+ }
+ else if ( proxy instanceof HibernateProxy ) {
+ HibernateProxyHelper.getLazyInitializer( (HibernateProxy) proxy ).initialize();
+ }
+ else if ( proxy instanceof PersistentCollection ) {
+ ( (PersistentCollection) proxy ).forceLoad();
}
}
|
|
From: <one...@us...> - 2002-10-31 15:09:57
|
Update of /cvsroot/hibernate/Hibernate In directory usw-pr-cvs1:/tmp/cvs-serv8698 Modified Files: changelog.txt Log Message: cirrus/hibernate/proxy/LazyInitializer.java Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.253 retrieving revision 1.254 diff -C2 -d -r1.253 -r1.254 *** changelog.txt 31 Oct 2002 14:02:17 -0000 1.253 --- changelog.txt 31 Oct 2002 15:09:51 -0000 1.254 *************** *** 4,8 **** ------------------------------------ * Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference() ! * support for quoted SQL identifiers Changes in version 1.1.8 (30.10.2002) --- 4,9 ---- ------------------------------------ * Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference() ! * support for quoted SQL identifiers (patch by Jean-Francois Nadeau) ! * Hibernate.initialize() allows the user to force initialization of a proxy or persistent collection Changes in version 1.1.8 (30.10.2002) |
|
From: <one...@us...> - 2002-10-31 14:06:04
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query
In directory usw-pr-cvs1:/tmp/cvs-serv3657/cirrus/hibernate/query
Modified Files:
QueryTranslator.java
Log Message:
support for SQL quoted identifiers
Index: QueryTranslator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** QueryTranslator.java 27 Oct 2002 03:11:33 -0000 1.38
--- QueryTranslator.java 31 Oct 2002 14:06:00 -0000 1.39
***************
*** 747,753 ****
Loadable[] persisters = getPersisters();
int size = persisters.length;
! String[] suffixes = new String[size];
for ( int i=0; i<size; i++ ) {
! if ( size>1 ) suffixes[i] = Integer.toString(i);
}
ArrayList list = new ArrayList();
--- 747,755 ----
Loadable[] persisters = getPersisters();
int size = persisters.length;
! String[][] aliases = new String[size][];
for ( int i=0; i<size; i++ ) {
! String suffix = (size==1) ? null : Integer.toString(i);
! aliases[i] = StringHelper.suffix( persisters[i].getIdentifierColumnNames(), suffix );
! StringHelper.unQuoteInPlace( aliases[i] );
}
ArrayList list = new ArrayList();
***************
*** 762,766 ****
for ( int i=0; i<size; i++ ) {
id = (Serializable) persisters[i].getIdentifierType().nullSafeGet(
! rs, StringHelper.suffix( persisters[i].getIdentifierColumnNames(), suffixes[i] ), session, null
);
if (size>1) ids[i] = id;
--- 764,768 ----
for ( int i=0; i<size; i++ ) {
id = (Serializable) persisters[i].getIdentifierType().nullSafeGet(
! rs, aliases[i], session, null
);
if (size>1) ids[i] = id;
|
|
From: <one...@us...> - 2002-10-31 14:02:21
|
Update of /cvsroot/hibernate/Hibernate In directory usw-pr-cvs1:/tmp/cvs-serv1542 Modified Files: changelog.txt todo.txt Log Message: support for SQL quoted identifiers Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.252 retrieving revision 1.253 diff -C2 -d -r1.252 -r1.253 *** changelog.txt 29 Oct 2002 16:09:03 -0000 1.252 --- changelog.txt 31 Oct 2002 14:02:17 -0000 1.253 *************** *** 1,4 **** --- 1,9 ---- Hibernate Changelog =================== + Changes in version 1.1.9 (x.11.2002) + ------------------------------------ + * Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference() + * support for quoted SQL identifiers + Changes in version 1.1.8 (30.10.2002) ------------------------------------- Index: todo.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/todo.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** todo.txt 30 Oct 2002 16:06:40 -0000 1.24 --- todo.txt 31 Oct 2002 14:02:18 -0000 1.25 *************** *** 2,6 **** ==== * normalized table-per-subclass mapping style - * Allow quoted SQL identifiers * immediate deep fetching for queries * allow version numbers to be tracked by persistence layer, not persistent objects (make property optional) --- 2,5 ---- |
|
From: <one...@us...> - 2002-10-31 14:00:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/loader
Modified Files:
Loader.java OuterJoinLoader.java
Log Message:
support for SQL quoted identifiers
Index: Loader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Loader.java 29 Oct 2002 02:45:42 -0000 1.22
--- Loader.java 31 Oct 2002 14:00:26 -0000 1.23
***************
*** 87,91 ****
final Map namedParams
) throws SQLException, HibernateException {
!
returnProxies = returnProxies && Environment.jvmSupportsProxies();
--- 87,91 ----
final Map namedParams
) throws SQLException, HibernateException {
!
returnProxies = returnProxies && Environment.jvmSupportsProxies();
***************
*** 95,104 ****
final boolean twoPhaseLoad = allowTwoPhaseLoad() && cols > 0;
final String[] suffixes = getSuffixes();
!
final ArrayList hydratedObjects = twoPhaseLoad ? new ArrayList() : null;
final Key optionalObjectKey;
//boolean success;
!
if (optionalObject!=null) {
optionalObjectKey = new Key( optionalID, session.getPersister(optionalObject) );
--- 95,104 ----
final boolean twoPhaseLoad = allowTwoPhaseLoad() && cols > 0;
final String[] suffixes = getSuffixes();
!
final ArrayList hydratedObjects = twoPhaseLoad ? new ArrayList() : null;
final Key optionalObjectKey;
//boolean success;
!
if (optionalObject!=null) {
optionalObjectKey = new Key( optionalID, session.getPersister(optionalObject) );
***************
*** 109,127 ****
//success = true;
}
!
final List results = new ArrayList(); //new cirrus.hibernate.collections.List(this);
final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session );
final ResultSet rs = getResultSet(st, namedParams, selection, session);
!
try {
!
final Key[] keys = new Key[cols]; //we can reuse it each time
final boolean[] hydrate = new boolean[cols]; //we can reuse it each time
!
while ( rs.next() ) {
for ( int i=0; i<cols; i++ ) {
! keys[i] = getKeyFromResultSet(persisters[i], suffixes[i], rs, session);
}
--- 109,127 ----
//success = true;
}
!
final List results = new ArrayList(); //new cirrus.hibernate.collections.List(this);
final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session );
final ResultSet rs = getResultSet(st, namedParams, selection, session);
!
try {
!
final Key[] keys = new Key[cols]; //we can reuse it each time
final boolean[] hydrate = new boolean[cols]; //we can reuse it each time
!
while ( rs.next() ) {
for ( int i=0; i<cols; i++ ) {
! keys[i] = getKeyFromResultSet( persisters[i], suffixes[i], rs, session );
}
***************
*** 150,157 ****
}
results.add( ( cols==1 ) ? row[0] : row );
!
if (collection) optionalCollection.readFrom( rs, getCollectionPersister() );
}
!
}
catch (SQLException sqle) {
--- 150,157 ----
}
results.add( ( cols==1 ) ? row[0] : row );
!
if (collection) optionalCollection.readFrom( rs, getCollectionPersister() );
}
!
}
catch (SQLException sqle) {
***************
*** 174,178 ****
return results;
!
}
--- 174,178 ----
return results;
!
}
***************
*** 183,190 ****
private Key getKeyFromResultSet(Loadable persister, String suffix, ResultSet rs, SessionImplementor session)
throws HibernateException, SQLException {
!
! Serializable id = (Serializable) persister.getIdentifierType().nullSafeGet(
! rs, StringHelper.suffix( persister.getIdentifierColumnNames(), suffix ), session, null
! );
return ( id==null ) ? null : new Key( id, persister );
}
--- 183,192 ----
private Key getKeyFromResultSet(Loadable persister, String suffix, ResultSet rs, SessionImplementor session)
throws HibernateException, SQLException {
!
! //TODO: we can cache these on this object, from the constructor
! String[] keyColNames = StringHelper.suffix( persister.getIdentifierColumnNames(), suffix );
! StringHelper.unQuoteInPlace(keyColNames);
!
! Serializable id = (Serializable) persister.getIdentifierType().nullSafeGet(rs, keyColNames, session, null);
return ( id==null ) ? null : new Key( id, persister );
}
***************
*** 294,303 ****
if ( persister.hasSubclasses() ) {
! // Code to handle subclasses of topClass
! String discr = persister.getDiscriminatorColumnName();
!
! Object discriminatorValue = persister.getDiscriminatorType().nullSafeGet(
! rs, (suffix==null) ? discr : discr + suffix, session, null
);
Class result = persister.getSubclassForDiscriminatorValue(discriminatorValue);
--- 296,306 ----
if ( persister.hasSubclasses() ) {
!
! String col = StringHelper.unQuote(
! StringHelper.suffix( persister.getDiscriminatorColumnName(), suffix )
);
+
+ // Code to handle subclasses of topClass
+ Object discriminatorValue = persister.getDiscriminatorType().nullSafeGet(rs, col, session, null);
Class result = persister.getSubclassForDiscriminatorValue(discriminatorValue);
***************
*** 323,330 ****
Type[] types = persister.getPropertyTypes();
Object[] values = new Object[ types.length ];
for (int i=0; i<types.length; i++) {
! values[i] = types[i].hydrate( rs, StringHelper.suffix( persister.getPropertyColumnNames(i), suffix ), session, object );
}
- //persister.setPropertyValues(object, values);
return values;
}
--- 326,337 ----
Type[] types = persister.getPropertyTypes();
Object[] values = new Object[ types.length ];
+
for (int i=0; i<types.length; i++) {
! //TODO: we can cache these on this object, from the constructor
! String[] cols = StringHelper.suffix( persister.getPropertyColumnNames(i), suffix );
! StringHelper.unQuoteInPlace(cols);
!
! values[i] = types[i].hydrate( rs, cols, session, object );
}
return values;
}
Index: OuterJoinLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OuterJoinLoader.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** OuterJoinLoader.java 22 Oct 2002 14:05:10 -0000 1.9
--- OuterJoinLoader.java 31 Oct 2002 14:00:26 -0000 1.10
***************
*** 208,213 ****
.append( keyCols[j] )
.append(" AS ")
! .append( keyCols[j] )
! .append(suffix);
if ( j != keyCols.length-1 ) buf.append(", ");
}
--- 208,212 ----
.append( keyCols[j] )
.append(" AS ")
! .append( aliasColumn(keyCols[j], suffix ));
if ( j != keyCols.length-1 ) buf.append(", ");
}
***************
*** 218,223 ****
.append( persister.getDiscriminatorColumnName() )
.append(" AS ")
! .append( persister.getDiscriminatorColumnName() )
! .append(suffix);
String[] cols = persister.getSubclassColumnClosure();
for ( int j=0; j<cols.length; j++ ) {
--- 217,221 ----
.append( persister.getDiscriminatorColumnName() )
.append(" AS ")
! .append( aliasColumn(persister.getDiscriminatorColumnName(), suffix ));
String[] cols = persister.getSubclassColumnClosure();
for ( int j=0; j<cols.length; j++ ) {
***************
*** 227,232 ****
.append( cols[j] )
.append(" AS ")
! .append( cols[j] )
! .append(suffix);
}
--- 225,229 ----
.append( cols[j] )
.append(" AS ")
! .append( aliasColumn(cols[j], suffix ));
}
***************
*** 275,287 ****
return suffixes;
}
! protected static String alias(String tableName, int n) {
! return (
! tableName.length() <=5 ?
! tableName :
! StringHelper.unqualify(tableName).substring(0, 5)
! ) + n;
}
}
--- 272,306 ----
return suffixes;
}
+
+ protected static String alias(String tableName, int n) {
! return aliasCore(tableName.length() <=5 ?
! tableName :
! StringHelper.unqualify(tableName).substring(0, 5),
! Integer.toString(n)
! );
}
+ protected static String aliasColumn(String columnName, String suffix) {
+ return aliasCore(columnName, suffix);
+ }
+
+ //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
+ private static String aliasCore(String name, String suffix) {
+
+ char quote = name.charAt(0);
+ boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
+
+ if (nameEscaped) name = name.substring(1, name.length()-1);
+
+ StringBuffer aliasBuilder = new StringBuffer(name.length());
+
+ if (nameEscaped) aliasBuilder.append(quote);
+ aliasBuilder.append(name);
+ aliasBuilder.append(suffix);
+ if (nameEscaped) aliasBuilder.append(quote);
+
+ return aliasBuilder.toString();
+ }
}
|
|
From: <one...@us...> - 2002-10-31 14:00:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/persister
Modified Files:
AbstractEntityPersister.java EntityPersister.java
Log Message:
support for SQL quoted identifiers
Index: AbstractEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/AbstractEntityPersister.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** AbstractEntityPersister.java 26 Oct 2002 16:43:27 -0000 1.9
--- AbstractEntityPersister.java 31 Oct 2002 14:00:25 -0000 1.10
***************
*** 1,564 ****
! //$Id$
! package cirrus.hibernate.persister;
!
! import java.io.Serializable;
! import java.lang.reflect.Constructor;
! import java.lang.reflect.Method;
! import java.lang.reflect.Modifier;
! import java.util.HashSet;
! import java.util.Iterator;
!
[...1116 lines suppressed...]
!
! //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
! protected static String aliasColumn(String name, String suffix) {
!
! char quote = name.charAt(0);
! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
!
! if (nameEscaped) name = name.substring(1, name.length()-1);
!
! StringBuffer aliasBuilder = new StringBuffer(name.length());
!
! if (nameEscaped) aliasBuilder.append(quote);
! aliasBuilder.append(name);
! aliasBuilder.append(suffix);
! if (nameEscaped) aliasBuilder.append(quote);
!
! return aliasBuilder.toString();
! }
!
! }
Index: EntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** EntityPersister.java 27 Oct 2002 03:11:33 -0000 1.32
--- EntityPersister.java 31 Oct 2002 14:00:25 -0000 1.33
***************
*** 998,1002 ****
.append(discr)
.append(" as ")
! .append(discr).append(suffix);
}
--- 998,1002 ----
.append(discr)
.append(" as ")
! .append( aliasColumn(discr, suffix) );
}
***************
*** 1004,1012 ****
for ( int i=0; i<cols.length; i++ ) {
! buf.append(", ").append(name).append('.').append( cols[i] ).append(" as ").append(cols[i]).append(suffix);
}
return buf.toString();
}
-
}
--- 1004,1016 ----
for ( int i=0; i<cols.length; i++ ) {
! buf.append(", ")
! .append(name)
! .append('.')
! .append( cols[i] )
! .append(" as ")
! .append( aliasColumn(cols[i], suffix) );
}
return buf.toString();
}
}
|
|
From: <one...@us...> - 2002-10-31 14:00:57
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/sql
Modified Files:
Dialect.java
Log Message:
support for SQL quoted identifiers
Index: Dialect.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/sql/Dialect.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** Dialect.java 27 Oct 2002 03:52:13 -0000 1.37
--- Dialect.java 31 Oct 2002 14:00:24 -0000 1.38
***************
*** 2,8 ****
--- 2,13 ----
package cirrus.hibernate.sql;
+ import java.io.InputStream;
import java.io.Serializable;
+ import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.Map;
import java.util.Properties;
***************
*** 10,13 ****
--- 15,19 ----
import org.apache.commons.logging.LogFactory;
+ import cirrus.hibernate.helpers.PropertiesHelper;
import cirrus.hibernate.helpers.ReflectHelper;
import cirrus.hibernate.helpers.StringHelper;
***************
*** 45,48 ****
--- 51,58 ----
private final Properties properties = new Properties();
private final OuterJoinGenerator outerJoinGenerator = new AnsiOuterJoinGenerator();
+
+ public static final String QUOTE="`\"";
+
+
/**
|
|
From: <one...@us...> - 2002-10-31 14:00:31
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/map
Modified Files:
Collection.java RootClass.java Subclass.java Value.java
Log Message:
support for SQL quoted identifiers
Index: Collection.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Collection.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** Collection.java 26 Oct 2002 16:43:27 -0000 1.44
--- Collection.java 31 Oct 2002 14:00:27 -0000 1.45
***************
*** 212,216 ****
public Index createIndex() {
Index index = new Index();
! index.setName( table.getQualifiedName() + "IDX" + table.generateConstraintID() );
index.setTable(table);
Iterator iter = getIdentifier().getColumnIterator();
--- 212,216 ----
public Index createIndex() {
Index index = new Index();
! index.setName( StringHelper.suffix( table.getQualifiedName(), "IDX" + table.generateConstraintID() ) );
index.setTable(table);
Iterator iter = getIdentifier().getColumnIterator();
Index: RootClass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/RootClass.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** RootClass.java 27 Oct 2002 03:11:33 -0000 1.47
--- RootClass.java 31 Oct 2002 14:00:27 -0000 1.48
***************
*** 223,227 ****
PrimaryKey pk = new PrimaryKey();
pk.setTable(table);
! pk.setName( table.getName() + "PK" );
Iterator iter = identifier.getColumnIterator();
while ( iter.hasNext() ) {
--- 223,227 ----
PrimaryKey pk = new PrimaryKey();
pk.setTable(table);
! pk.setName( StringHelper.suffix( table.getName(), "PK" ) );
Iterator iter = identifier.getColumnIterator();
while ( iter.hasNext() ) {
Index: Subclass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Subclass.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Subclass.java 11 Oct 2002 04:37:43 -0000 1.17
--- Subclass.java 31 Oct 2002 14:00:28 -0000 1.18
***************
*** 8,11 ****
--- 8,12 ----
import cirrus.hibernate.cache.CacheConcurrencyStrategy;
import cirrus.hibernate.helpers.JoinedIterator;
+ import cirrus.hibernate.helpers.StringHelper;
import cirrus.hibernate.persister.EntityPersister;
import cirrus.hibernate.persister.MultiTableEntityPersister;
***************
*** 118,122 ****
PrimaryKey pk = new PrimaryKey();
pk.setTable(this.table);
! pk.setName( tableName + "PK" );
this.table.setPrimaryKey(pk);
--- 119,123 ----
PrimaryKey pk = new PrimaryKey();
pk.setTable(this.table);
! pk.setName( StringHelper.suffix( tableName, "PK" ) );
this.table.setPrimaryKey(pk);
Index: Value.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Value.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Value.java 27 Oct 2002 03:11:33 -0000 1.39
--- Value.java 31 Oct 2002 14:00:28 -0000 1.40
***************
*** 7,10 ****
--- 7,11 ----
import cirrus.hibernate.*;
import cirrus.hibernate.helpers.ReflectHelper;
+ import cirrus.hibernate.helpers.StringHelper;
import cirrus.hibernate.id.Assigned;
import cirrus.hibernate.id.IdentifierGenerator;
***************
*** 115,119 ****
}
fk.setTable(table);
! fk.setName( table.getName() + "FK" + table.generateConstraintID() );
fk.setReferencedClass(persistentClass);
root.addForeignKey(fk);
--- 116,120 ----
}
fk.setTable(table);
! fk.setName( StringHelper.suffix( table.getName(), "FK" + table.generateConstraintID() ) );
fk.setReferencedClass(persistentClass);
root.addForeignKey(fk);
|
|
From: <one...@us...> - 2002-10-31 14:00:31
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/helpers
Modified Files:
StringHelper.java
Log Message:
support for SQL quoted identifiers
Index: StringHelper.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/StringHelper.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** StringHelper.java 28 Oct 2002 15:41:53 -0000 1.16
--- StringHelper.java 31 Oct 2002 14:00:28 -0000 1.17
***************
*** 4,7 ****
--- 4,9 ----
import java.util.*;
+ import cirrus.hibernate.sql.Dialect;
+
public final class StringHelper {
***************
*** 88,96 ****
String[] qualified = new String[columns.length];
for ( int i=0; i<columns.length; i++ ) {
! qualified[i] = columns[i] + suffix;
}
return qualified;
}
public static String[] prefix( String[] columns, String prefix) {
if (prefix==null) return columns;
--- 90,109 ----
String[] qualified = new String[columns.length];
for ( int i=0; i<columns.length; i++ ) {
! qualified[i] = suffix( columns[i], suffix);
}
return qualified;
}
+ public static String suffix(String table, String suffix) {
+ if (suffix==null) return table;
+ char quote = table.charAt(0);
+ if ( Dialect.QUOTE.indexOf(quote) > -1 ) {
+ return table.substring( 0, table.length()-1 ) + suffix + quote;
+ }
+ else {
+ return table + suffix;
+ }
+ }
+
public static String[] prefix( String[] columns, String prefix) {
if (prefix==null) return columns;
***************
*** 140,142 ****
--- 153,170 ----
}
+ public static String unQuote(String name) {
+ return ( Dialect.QUOTE.indexOf( name.charAt(0) ) > -1 ) ?
+ name.substring(1, name.length()-1) :
+ name;
+ }
+
+ public static void unQuoteInPlace(String[] names) {
+ for ( int i=0; i<names.length; i++ ) names[i] = unQuote( names[i] );
+ }
+ public static String[] unQuote(String[] names) {
+ String[] unquoted = new String[ names.length ];
+ for ( int i=0; i<names.length; i++ ) unquoted[i] = unQuote( names[i] );
+ return unquoted;
+ }
+
}
|
|
From: <one...@us...> - 2002-10-31 14:00:31
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory usw-pr-cvs1:/tmp/cvs-serv519/cirrus/hibernate/impl
Modified Files:
CollectionPersister.java
Log Message:
support for SQL quoted identifiers
Index: CollectionPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/CollectionPersister.java,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** CollectionPersister.java 22 Oct 2002 14:05:09 -0000 1.82
--- CollectionPersister.java 31 Oct 2002 14:00:26 -0000 1.83
***************
*** 54,58 ****
--- 54,60 ----
private transient final String[] keyColumnNames;
private transient final String[] indexColumnNames;
+ private transient final String[] unquotedIndexColumnNames;
private transient final String[] elementColumnNames;
+ private transient final String[] unquotedElementColumnNames;
private transient final String[] rowSelectColumnNames;
private transient final Type rowSelectType;
***************
*** 145,151 ****
elementColumnNames[i] = col.getName();
i++;
! }
!
}
if ( hasIndex = collection.isIndexed() ) {
--- 147,154 ----
elementColumnNames[i] = col.getName();
i++;
! }
}
+ unquotedElementColumnNames = StringHelper.unQuote(elementColumnNames);
+
if ( hasIndex = collection.isIndexed() ) {
***************
*** 162,169 ****
--- 165,174 ----
rowSelectColumnNames = indexColumnNames;
rowSelectType = indexType;
+ unquotedIndexColumnNames = StringHelper.unQuote(indexColumnNames);
}
else {
indexType = null;
indexColumnNames = null;
+ unquotedIndexColumnNames = null;
rowSelectColumnNames = elementColumnNames;
rowSelectType = elementType;
***************
*** 300,308 ****
public Object readElement(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! Object element = getElementType().nullSafeGet(rs, elementColumnNames, session, null);
return element;
}
public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! return getIndexType().nullSafeGet(rs, indexColumnNames, session, null);
}
--- 305,313 ----
public Object readElement(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! Object element = getElementType().nullSafeGet(rs, unquotedElementColumnNames, session, null);
return element;
}
public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! return getIndexType().nullSafeGet(rs, unquotedIndexColumnNames, session, null);
}
|