You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2003-03-12 12:40:55
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv31825/cirrus/hibernate Modified Files: Query.java Log Message: Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing types) Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Query.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Query.java 31 Jan 2003 08:50:49 -0000 1.20 --- Query.java 12 Mar 2003 12:40:52 -0000 1.21 *************** *** 154,158 **** * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(int position, Object val) throws HibernateException; /** * Bind a value to a named query parameter, guessing the Hibernate --- 154,158 ---- * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(int position, Object val) throws HibernateException, SQLException; /** * Bind a value to a named query parameter, guessing the Hibernate *************** *** 162,166 **** * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(String name, Object val) throws HibernateException; /** --- 162,166 ---- * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(String name, Object val) throws HibernateException, SQLException; /** *************** *** 180,184 **** * @param vals a collection of values to list */ ! public void setParameterList(String name, Collection vals) throws HibernateException; /** --- 180,184 ---- * @param vals a collection of values to list */ ! public void setParameterList(String name, Collection vals) throws HibernateException, SQLException; /** *************** *** 188,192 **** * @param bean any JavaBean or POJO */ ! public void setProperties(Object bean) throws HibernateException; public void setString(int position, String val); --- 188,192 ---- * @param bean any JavaBean or POJO */ ! public void setProperties(Object bean) throws HibernateException, SQLException; public void setString(int position, String val); *************** *** 238,242 **** * @param val a non-null instance of a persistent class */ ! public void setEntity(int position, Object val); // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. --- 238,242 ---- * @param val a non-null instance of a persistent class */ ! public void setEntity(int position, Object val) throws HibernateException, SQLException; // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. *************** *** 252,256 **** * @param val a non-null instance of a persistent class */ ! public void setEntity(String name, Object val); // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. --- 252,256 ---- * @param val a non-null instance of a persistent class */ ! public void setEntity(String name, Object val) throws HibernateException, SQLException; // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. |
From: <one...@us...> - 2003-03-12 12:40:55
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv31825 Modified Files: changelog.txt Log Message: Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing types) Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.298 retrieving revision 1.299 diff -C2 -d -r1.298 -r1.299 *** changelog.txt 5 Mar 2003 09:50:04 -0000 1.298 --- changelog.txt 12 Mar 2003 12:40:52 -0000 1.299 *************** *** 9,12 **** --- 9,13 ---- * support [] quoted identifiers * added Ant Tasks for SchemaExport and SchemaUpdater (Cameron Braid) + * Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing Type) Changes in version 1.2.3 (28.1.2003) |
From: <one...@us...> - 2003-03-12 12:29:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv27355/src/net/sf/hibernate Modified Files: Hibernate.java Query.java Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Hibernate.java 8 Mar 2003 06:31:22 -0000 1.7 --- Hibernate.java 12 Mar 2003 12:28:57 -0000 1.8 *************** *** 217,220 **** --- 217,237 ---- /** + * Is the proxy or persistent collection initialized? + * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> + * @retrun true if the argument is already initialized, or is not a proxy or collection + */ + public static boolean isInitialized(Object proxy) { + if ( proxy instanceof HibernateProxy ) { + return !HibernateProxyHelper.getLazyInitializer( (HibernateProxy) proxy ).isUninitialized(); + } + else if ( proxy instanceof PersistentCollection ) { + return ( (PersistentCollection) proxy ).wasInitialized(); + } + else { + return true; + } + } + + /** * Create a new <tt>Blob</tt>. The returned object will be * initially immutable. Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Query.java 9 Mar 2003 04:04:05 -0000 1.9 --- Query.java 12 Mar 2003 12:28:58 -0000 1.10 *************** *** 253,257 **** * @param val a non-null instance of a persistent class */ ! public Query setEntity(int position, Object val); // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. --- 253,257 ---- * @param val a non-null instance of a persistent class */ ! public Query setEntity(int position, Object val) throws HibernateException; // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. *************** *** 267,271 **** * @param val a non-null instance of a persistent class */ ! public Query setEntity(String name, Object val); // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. --- 267,271 ---- * @param val a non-null instance of a persistent class */ ! public Query setEntity(String name, Object val) throws HibernateException; // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. |
From: <one...@us...> - 2003-03-12 12:29:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv27355/src/net/sf/hibernate/impl Modified Files: QueryImpl.java Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** QueryImpl.java 9 Mar 2003 04:04:08 -0000 1.10 --- QueryImpl.java 12 Mar 2003 12:28:58 -0000 1.11 *************** *** 24,27 **** --- 24,29 ---- import net.sf.hibernate.engine.SessionImplementor; import net.sf.hibernate.engine.TypedValue; + import net.sf.hibernate.proxy.HibernateProxyHelper; + import net.sf.hibernate.type.SerializableType; import net.sf.hibernate.type.Type; import net.sf.hibernate.type.TypeFactory; *************** *** 172,176 **** } ! public Query setEntity(int position, Object val) { setParameter( position, val, Hibernate.association( val.getClass() ) ); return this; --- 174,179 ---- } ! public Query setEntity(int position, Object val) throws HibernateException { ! val = HibernateProxyHelper.unproxy(val, session); setParameter( position, val, Hibernate.association( val.getClass() ) ); return this; *************** *** 227,231 **** } ! public Query setEntity(String name, Object val) { setParameter( name, val, Hibernate.association( val.getClass() ) ); return this; --- 230,235 ---- } ! public Query setEntity(String name, Object val) throws HibernateException { ! val = HibernateProxyHelper.unproxy(val, session); setParameter( name, val, Hibernate.association( val.getClass() ) ); return this; *************** *** 318,321 **** --- 322,326 ---- private Type guessType(Object param) throws HibernateException { + param = HibernateProxyHelper.unproxy(param, session); Class clazz = param.getClass(); return guessType(clazz); *************** *** 325,338 **** String typename = clazz.getName(); Type type = TypeFactory.hueristicType(typename); ! if (type==null ) { try { session.getFactory().getPersister(clazz); } catch (MappingException me) { ! throw new HibernateException("Could not determine a type for class: " + typename); } ! type = Hibernate.association(clazz); } - return type; } --- 330,351 ---- String typename = clazz.getName(); Type type = TypeFactory.hueristicType(typename); ! boolean serializable = type!=null && type instanceof SerializableType; ! if (type==null || serializable) { try { session.getFactory().getPersister(clazz); } catch (MappingException me) { ! if (serializable) { ! return type; ! } ! else { ! throw new HibernateException("Could not determine a type for class: " + typename); ! } } ! return Hibernate.association(clazz); ! } ! else { ! return type; } } *************** *** 384,387 **** --- 397,401 ---- public Query setProperties(Object bean) throws HibernateException { + bean = HibernateProxyHelper.unproxy(bean, session); Class clazz = bean.getClass(); Iterator iter = session.getFactory().getNamedParameters(queryString).iterator(); |
From: <one...@us...> - 2003-03-12 12:29:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv27355/src/net/sf/hibernate/dialect Modified Files: PostgreSQLDialect.java Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: PostgreSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PostgreSQLDialect.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PostgreSQLDialect.java 11 Feb 2003 11:22:02 -0000 1.6 --- PostgreSQLDialect.java 12 Mar 2003 12:28:58 -0000 1.7 *************** *** 51,55 **** public String getCascadeConstraintsString() { ! return " cascade"; } --- 51,55 ---- public String getCascadeConstraintsString() { ! return "";// cascade"; } |
From: <one...@us...> - 2003-03-12 12:29:00
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv27355 Modified Files: build.xml changelog.txt demo.bat demo.sh Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: build.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 8 Mar 2003 06:41:45 -0000 1.10 --- build.xml 12 Mar 2003 12:28:57 -0000 1.11 *************** *** 47,50 **** --- 47,52 ---- <include name="**/*.xml"/> <include name="**/*.xslt"/> + + <!-- exclude everything we don't want in the jar --> <exclude name="${build.dir}/**/*"/> <exclude name="${doc.dir}/**/*"/> *************** *** 54,57 **** --- 56,60 ---- <exclude name="**/*.properties"/> <exclude name="**/*.ccf"/> + <exclude name="**/*.cfg.xml"/> </patternset> *************** *** 96,111 **** <target name="compile" depends="init" description="Compile the Java source code"> ! <available ! classname="org.eclipse.core.launcher.Main" ! property="build.compiler" ! value="org.eclipse.jdt.core.JDTCompilerAdapter" ! classpath="${java.class.path}"/> ! <javac ! srcdir="${src.dir}" ! destdir="${build.dir}" ! classpathref="lib.class.path" ! debug="${javac.debug}" ! optimize="${javac.optimize}" ! nowarn="on"/> </target> --- 99,114 ---- <target name="compile" depends="init" description="Compile the Java source code"> ! <available ! classname="org.eclipse.core.launcher.Main" ! property="build.compiler" ! value="org.eclipse.jdt.core.JDTCompilerAdapter" ! classpath="${java.class.path}"/> ! <javac ! srcdir="${src.dir}" ! destdir="${build.dir}" ! classpathref="lib.class.path" ! debug="${javac.debug}" ! optimize="${javac.optimize}" ! nowarn="on"/> </target> *************** *** 115,118 **** --- 118,123 ---- <fileset dir="${src.dir}"> <patternset refid="source.files"/> + </fileset> + <fileset dir="${src.dir}"> <patternset refid="support.files"/> </fileset> Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changelog.txt 5 Mar 2003 09:48:53 -0000 1.10 --- changelog.txt 12 Mar 2003 12:28:57 -0000 1.11 *************** *** 19,22 **** --- 19,25 ---- * fixed a bug in Query.setParameterList() * Ingres support (Ian Booth) + * new (experimental) Criteria + Expression APIs + * Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing Type) + * added Hibernate.isInitialized() Changes in version 2.0 beta 3 (24.2.2003) Index: demo.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/demo.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** demo.bat 1 Mar 2003 13:11:16 -0000 1.3 --- demo.bat 12 Mar 2003 12:28:57 -0000 1.4 *************** *** 1,2 **** set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip ! java -cp src;%JDBC_DRIVER%;lib\commons-logging.jar;lib\commons-collections.jar;lib\commons-beanutils.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;hibernate2.jar net.sf.hibernate.eg.NetworkDemo --- 1,2 ---- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip ! java -cp src;%JDBC_DRIVER%;lib\commons-logging.jar;lib\commons-collections.jar;lib\commons-beanutils.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;lib\dom4j.jar;hibernate2.jar net.sf.hibernate.eg.NetworkDemo Index: demo.sh =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/demo.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** demo.sh 1 Mar 2003 13:11:16 -0000 1.4 --- demo.sh 12 Mar 2003 12:28:57 -0000 1.5 *************** *** 1,3 **** #!/bin/sh JDBC_DRIVER=/opt/pgsql/lib/postgresql-jdbc3-7.3.jar ! java -cp ./src:$JDBC_DRIVER:./lib/commons-logging.jar:./lib/commons-collections.jar:./lib/commons-lang.jar:./lib/commons-beanutils.jar:./lib/cglib.jar:./lib/bcel.jar:./lib/odmg.jar:./lib/jdom.jar:./lib/xml-apis.jar:./lib/xerces.jar:./lib/xalan.jar:./hibernate2.jar net.sf.hibernate.eg.NetworkDemo --- 1,3 ---- #!/bin/sh JDBC_DRIVER=/opt/pgsql/lib/postgresql-jdbc3-7.3.jar ! java -cp ./src:$JDBC_DRIVER:./lib/commons-logging.jar:./lib/commons-collections.jar:./lib/commons-lang.jar:./lib/commons-beanutils.jar:./lib/cglib.jar:./lib/bcel.jar:./lib/odmg.jar:./lib/jdom.jar:./lib/dom4j.jar:./lib/xml-apis.jar:./lib/xerces.jar:./lib/xalan.jar:./hibernate2.jar net.sf.hibernate.eg.NetworkDemo |
From: <one...@us...> - 2003-03-12 12:29:00
|
Update of /cvsroot/hibernate/Hibernate2/bin In directory sc8-pr-cvs1:/tmp/cvs-serv27355/bin Modified Files: CodeGenerator.bat MapGenerator.bat ReverseGenerator.bat SchemaExport.bat SchemaUpdate.bat Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: CodeGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/bin/CodeGenerator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeGenerator.bat 1 Mar 2003 13:11:16 -0000 1.2 --- CodeGenerator.bat 12 Mar 2003 12:28:57 -0000 1.3 *************** *** 9,13 **** set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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% net.sf.hibernate.tool.hbm2java.CodeGenerator %* --- 9,13 ---- set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% net.sf.hibernate.tool.hbm2java.CodeGenerator %* Index: MapGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/bin/MapGenerator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapGenerator.bat 1 Mar 2003 13:11:16 -0000 1.2 --- MapGenerator.bat 12 Mar 2003 12:28:57 -0000 1.3 *************** *** 9,13 **** set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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% net.sf.hibernate.tool.class2hbm.MapGenerator %* --- 9,13 ---- set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% net.sf.hibernate.tool.class2hbm.MapGenerator %* Index: ReverseGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/bin/ReverseGenerator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReverseGenerator.bat 1 Mar 2003 13:11:16 -0000 1.2 --- ReverseGenerator.bat 12 Mar 2003 12:28:57 -0000 1.3 *************** *** 9,13 **** set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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% net.sf.hibernate.tool.ddl2hbm.Gui --- 9,13 ---- set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% net.sf.hibernate.tool.ddl2hbm.Gui Index: SchemaExport.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/bin/SchemaExport.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SchemaExport.bat 1 Mar 2003 13:11:16 -0000 1.2 --- SchemaExport.bat 12 Mar 2003 12:28:57 -0000 1.3 *************** *** 9,13 **** set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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% net.sf.hibernate.tool.hbm2ddl.SchemaExport %* --- 9,13 ---- set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% net.sf.hibernate.tool.hbm2ddl.SchemaExport %* Index: SchemaUpdate.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/bin/SchemaUpdate.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SchemaUpdate.bat 1 Mar 2003 13:11:16 -0000 1.2 --- SchemaUpdate.bat 12 Mar 2003 12:28:57 -0000 1.3 *************** *** 9,13 **** set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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% net.sf.hibernate.tool.hbm2ddl.SchemaUpdate %* --- 9,13 ---- set LIB=%HIBERNATE_HOME%\lib set PROPS=%HIBERNATE_HOME%\src ! set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.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%\dom4j.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% net.sf.hibernate.tool.hbm2ddl.SchemaUpdate %* |
From: <one...@us...> - 2003-03-12 12:29:00
|
Update of /cvsroot/hibernate/Hibernate2/src In directory sc8-pr-cvs1:/tmp/cvs-serv27355/src Modified Files: hibernate.properties Log Message: include hibernate.properties in src dir fix classpaths of batch scripts Query.setEntity(), etc now proxy-aware Query.guessType() now handles serializable entities properly Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/hibernate.properties,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** hibernate.properties 2 Feb 2003 06:47:06 -0000 1.14 --- hibernate.properties 12 Mar 2003 12:28:57 -0000 1.15 *************** *** 161,165 **** ################################# ! hibernate.connection.pool_size 0 hibernate.statement_cache.size 0 --- 161,165 ---- ################################# ! hibernate.connection.pool_size 1 hibernate.statement_cache.size 0 |
From: <one...@us...> - 2003-03-12 08:24:27
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv23801/hibernate/util Modified Files: StringHelper.java Log Message: added con/dis-junctions and ilike operator Index: StringHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/StringHelper.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StringHelper.java 9 Mar 2003 04:04:10 -0000 1.9 --- StringHelper.java 12 Mar 2003 08:24:24 -0000 1.10 *************** *** 28,31 **** --- 28,40 ---- } + public static String join(String seperator, Iterator objects) { + StringBuffer buf = new StringBuffer(); + buf.append( objects.next() ); + while ( objects.hasNext() ) { + buf.append(seperator).append( objects.next() ); + } + return buf.toString(); + } + public static String repeat(String string, int times) { |
From: <one...@us...> - 2003-03-12 08:24:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv23801/hibernate/test Modified Files: FooBarTest.java Log Message: added con/dis-junctions and ilike operator Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** FooBarTest.java 9 Mar 2003 04:04:09 -0000 1.40 --- FooBarTest.java 12 Mar 2003 08:24:24 -0000 1.41 *************** *** 148,151 **** --- 148,162 ---- .list(); assertTrue( list.size()==1 && list.get(0)==f ); + + list = s.createCriteria(Foo.class).add( + Expression.disjunction() + .add( Expression.eq( "integer", f.getInteger() ) ) + .add( Expression.like( "string", f.getString() ) ) + .add( Expression.eq( "boolean", f.getBoolean() ) ) + ) + .add( Expression.isNotNull("boolean") ) + .list(); + assertTrue( list.size()==1 && list.get(0)==f ); + list = s.createCriteria(Foo.class) .add( Expression.or( |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression In directory sc8-pr-cvs1:/tmp/cvs-serv23801/hibernate/expression Modified Files: Expression.java Added Files: Conjunction.java Disjunction.java IlikeExpression.java Junction.java Log Message: added con/dis-junctions and ilike operator --- NEW FILE: Conjunction.java --- package net.sf.hibernate.expression; /** * */ public class Conjunction extends Junction { /** * @see net.sf.hibernate.expression.Junction#getOp() */ String getOp() { return " and "; } } --- NEW FILE: Disjunction.java --- package net.sf.hibernate.expression; /** * */ public class Disjunction extends Junction { /** * @see net.sf.hibernate.expression.Junction#getOp() */ String getOp() { return " or "; } } --- NEW FILE: IlikeExpression.java --- //$Id: IlikeExpression.java,v 1.1 2003/03/12 08:24:23 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.dialect.Dialect; import net.sf.hibernate.dialect.PostgreSQLDialect; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; /** * */ public class IlikeExpression extends Expression { private final String propertyName; private final Object value; IlikeExpression(String propertyName, Object value) { this.propertyName = propertyName; this.value = value; } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.SessionFactory) */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { Dialect dialect = sessionFactory.getDialect(); String[] columns = getColumns(sessionFactory, persistentClass, propertyName, alias); if (columns.length!=1) throw new HibernateException("ilike may only be used with single-column properties"); if ( dialect instanceof PostgreSQLDialect ) { return columns[0] + " ilike ?"; } else { return dialect.getLowercaseFunction() + '(' + columns[0] + ") like ?"; } //TODO: get SQL rendering out of this package! } public TypedValue[] getTypedValues(SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { return new TypedValue[] { getTypedValue( sessionFactory, persistentClass, propertyName, value.toString().toLowerCase() ) }; } public String toString() { return propertyName + " ilike " + value; } } --- NEW FILE: Junction.java --- package net.sf.hibernate.expression; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.util.StringHelper; /** * @author Administrator * */ public abstract class Junction extends Expression { private List expressions = new ArrayList(); public Junction add(Expression expression) { expressions.add(expression); return this; } abstract String getOp(); /** * @see net.sf.hibernate.expression.Expression#getTypedValues(net.sf.hibernate.engine.SessionFactoryImplementor, java.lang.Class) */ public TypedValue[] getTypedValues( SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { ArrayList typedValues = new ArrayList(); Iterator iter = expressions.iterator(); while ( iter.hasNext() ) { TypedValue[] subvalues = ( (Expression) iter.next() ).getTypedValues(sessionFactory, persistentClass); for ( int i=0; i<subvalues.length; i++ ) { typedValues.add( subvalues[i] ); } } return (TypedValue[]) typedValues.toArray( new TypedValue[ typedValues.size() ] ); } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.engine.SessionFactoryImplementor, java.lang.Class, java.lang.String) */ public String toSqlString( SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { if ( expressions.size()==0 ) return "1=1"; StringBuffer buffer = new StringBuffer() .append('('); Iterator iter = expressions.iterator(); while ( iter.hasNext() ) { buffer.append( ( (Expression) iter.next() ).toSqlString(sessionFactory, persistentClass, alias) ); if ( iter.hasNext() ) buffer.append( getOp() ); } return buffer.append(')').toString(); } /** * @see java.lang.Object#toString() */ public String toString() { return '(' + StringHelper.join( getOp(), expressions.iterator() ) + ')'; } } Index: Expression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/Expression.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Expression.java 9 Mar 2003 04:04:06 -0000 1.2 --- Expression.java 12 Mar 2003 08:24:23 -0000 1.3 *************** *** 3,6 **** --- 3,8 ---- import java.util.Collection; + import java.util.Iterator; + import java.util.Map; import net.sf.hibernate.HibernateException; *************** *** 43,46 **** --- 45,59 ---- } /** + * A case-insensitive "like", similar to Postgres <tt>ilike</tt> + * operator + * + * @param propertyName + * @param value + * @return Expression + */ + public static Expression ilike(String propertyName, Object value) { + return new IlikeExpression(propertyName, value); + } + /** * Apply a "greater than" constraint to the named property * @param propertyName *************** *** 183,186 **** --- 196,234 ---- public static Expression sql(String sql) { return new SQLExpression(sql, NO_OBJECTS, NO_TYPES); + } + + /** + * Group expressions together in a single conjunction (A and B and C...) + * + * @return Conjunction + */ + public static Conjunction conjunction() { + return new Conjunction(); + } + + /** + * Group expressions together in a single disjunction (A or B or C...) + * + * @return Conjunction + */ + public static Disjunction disjunction() { + return new Disjunction(); + } + + /** + * Apply an "equals" constraint to each property in the + * key set of a <tt>Map</tt> + * + * @param propertyNameValues a map from property names to values + * @return Expression + */ + public static Expression allEq(Map propertyNameValues) { + Conjunction conj = conjunction(); + Iterator iter = propertyNameValues.entrySet().iterator(); + while ( iter.hasNext() ) { + Map.Entry me = (Map.Entry) iter.next(); + conj.add( eq( (String) me.getKey(), me.getValue() ) ); + } + return conj; } |
From: <one...@us...> - 2003-03-12 08:24:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv23801/hibernate/sql Modified Files: QuerySelect.java Log Message: added con/dis-junctions and ilike operator Index: QuerySelect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/QuerySelect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuerySelect.java 1 Mar 2003 06:14:10 -0000 1.2 --- QuerySelect.java 12 Mar 2003 08:24:23 -0000 1.3 *************** *** 94,98 **** .append("select "); if (distinct) buf.append("distinct "); ! buf.append(select) .append(" from") .append( joins.toFromFragmentString().substring(1) ); --- 94,98 ---- .append("select "); if (distinct) buf.append("distinct "); ! buf.append( select.toString() ) .append(" from") .append( joins.toFromFragmentString().substring(1) ); *************** *** 108,114 **** if (hasPart1) buf.append(")"); } ! if ( groupBy.length() > 0 ) buf.append(" group by ").append(groupBy); ! if ( having.length() > 0 ) buf.append(" having ").append(having); ! if ( orderBy.length() > 0 ) buf.append(" order by ").append(orderBy); return buf.toString(); } --- 108,114 ---- if (hasPart1) buf.append(")"); } ! if ( groupBy.length() > 0 ) buf.append(" group by ").append( groupBy.toString() ); ! if ( having.length() > 0 ) buf.append(" having ").append( having.toString() ); ! if ( orderBy.length() > 0 ) buf.append(" order by ").append( orderBy.toString() ); return buf.toString(); } |
From: <one...@us...> - 2003-03-12 08:24:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv23801/hibernate/dialect Modified Files: Dialect.java IngresDialect.java Log Message: added con/dis-junctions and ilike operator Index: Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Dialect.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Dialect.java 4 Mar 2003 14:36:20 -0000 1.10 --- Dialect.java 12 Mar 2003 08:24:23 -0000 1.11 *************** *** 336,339 **** --- 336,349 ---- } + /** + * The name of the SQL function that transforms a string to + * lowercase + * + * @return String + */ + public String getLowercaseFunction() { + return "lower"; + } + } Index: IngresDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/IngresDialect.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IngresDialect.java 29 Jan 2003 12:54:57 -0000 1.1 --- IngresDialect.java 12 Mar 2003 08:24:23 -0000 1.2 *************** *** 43,45 **** --- 43,50 ---- return false; } + + public String getLowercaseFunction() { + return "lowercase"; + } + } |
From: <one...@us...> - 2003-03-09 04:23:36
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/test Modified Files: Baz.hbm.xml FooBarTest.java MultiTableTest.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Baz.hbm.xml 15 Feb 2003 01:00:55 -0000 1.11 --- Baz.hbm.xml 9 Mar 2003 04:04:09 -0000 1.12 *************** *** 98,102 **** </map> ! <array name="fooArray" element-class="net.sf.hibernate.test.FooProxy"> <!--<jcs-cache usage="read-write"/>--> <key column="id_" /> --- 98,102 ---- </map> ! <array name="fooArray" element-class="net.sf.hibernate.test.FooProxy" where="i<8"> <!--<jcs-cache usage="read-write"/>--> <key column="id_" /> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FooBarTest.java 8 Mar 2003 06:31:23 -0000 1.39 --- FooBarTest.java 9 Mar 2003 04:04:09 -0000 1.40 *************** *** 20,23 **** --- 20,24 ---- import junit.framework.TestSuite; import net.sf.hibernate.expression.Expression; + import net.sf.hibernate.expression.Order; import net.sf.hibernate.Databinder; import net.sf.hibernate.FlushMode; *************** *** 157,165 **** .list(); assertTrue( list.size()==1 && list.get(0)==f ); ! list = s.createCriteria(Foo.class).setMaxResults(5).list(); assertTrue( list.size()==1 && list.get(0)==f ); list = s.createCriteria(Foo.class).setMaxResults(0).list(); assertTrue( list.size()==0 ); ! list = s.createCriteria(Foo.class).setFirstResult(1).list(); assertTrue( list.size()==0 ); s.delete(f); --- 158,173 ---- .list(); assertTrue( list.size()==1 && list.get(0)==f ); ! list = s.createCriteria(Foo.class) ! .setMaxResults(5) ! .addOrder( Order.asc("date") ) ! .list(); assertTrue( list.size()==1 && list.get(0)==f ); list = s.createCriteria(Foo.class).setMaxResults(0).list(); assertTrue( list.size()==0 ); ! list = s.createCriteria(Foo.class) ! .setFirstResult(1) ! .addOrder( Order.asc("date") ) ! .addOrder( Order.desc("string") ) ! .list(); assertTrue( list.size()==0 ); s.delete(f); *************** *** 179,182 **** --- 187,217 ---- s.connection().commit(); s.close(); + } + + public void testCollectionWhere() throws Exception { + Foo foo1 = new Foo(); + Foo foo2 = new Foo(); + Baz baz = new Baz(); + Foo[] arr = new Foo[10]; + arr[0] = foo1; + arr[9] = foo2; + Session s = sessions.openSession(); + s.save(foo1); + s.save(foo2); + baz.setFooArray(arr); + s.save(baz); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + baz = (Baz) s.load( Baz.class, baz.getCode() ); + assertTrue( baz.getFooArray().length==1 ); + assertTrue( s.find("from Baz baz, baz.fooArray foo").size()==1 ); + assertTrue( s.find("from Foo foo").size()==2 ); + assertTrue( s.filter( baz.getFooArray(), "" ).size()==1 ); + assertTrue( s.delete("from java.lang.Object o")==9 ); + s.flush(); + s.connection().commit(); + s.close(); } Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MultiTableTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MultiTableTest.java 6 Mar 2003 11:11:39 -0000 1.9 --- MultiTableTest.java 9 Mar 2003 04:04:09 -0000 1.10 *************** *** 447,450 **** --- 447,451 ---- sess.flush(); sess.connection().commit(); + sess.close(); sess = sessions.openSession(); *************** *** 454,457 **** --- 455,459 ---- sess.flush(); sess.connection().commit(); + sess.close(); } |
From: <one...@us...> - 2003-03-09 04:23:36
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/util Modified Files: StringHelper.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: StringHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/StringHelper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StringHelper.java 4 Mar 2003 14:36:23 -0000 1.8 --- StringHelper.java 9 Mar 2003 04:04:10 -0000 1.9 *************** *** 2,6 **** package net.sf.hibernate.util; ! import java.util.*; import net.sf.hibernate.dialect.Dialect; --- 2,7 ---- package net.sf.hibernate.util; ! import java.util.Iterator; ! import java.util.StringTokenizer; import net.sf.hibernate.dialect.Dialect; *************** *** 67,71 **** public static String[] split(String seperators, String list) { ! StringTokenizer tokens = new StringTokenizer(list, seperators); String[] result = new String[ tokens.countTokens() ]; int i=0; --- 68,76 ---- public static String[] split(String seperators, String list) { ! return split(seperators, list, false); ! } ! ! public static String[] split(String seperators, String list, boolean include) { ! StringTokenizer tokens = new StringTokenizer(list, seperators, include); String[] result = new String[ tokens.countTokens() ]; int i=0; |
From: <one...@us...> - 2003-03-09 04:23:36
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/loader Modified Files: CriteriaLoader.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: CriteriaLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CriteriaLoader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CriteriaLoader.java 8 Mar 2003 06:39:21 -0000 1.1 --- CriteriaLoader.java 9 Mar 2003 04:04:08 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.expression.Expression; + import net.sf.hibernate.expression.Order; import net.sf.hibernate.impl.CriteriaImpl; import net.sf.hibernate.persister.Loadable; *************** *** 31,35 **** StringBuffer condition = new StringBuffer(30); Iterator iter = criteria.iterateExpressions(); ! if ( !iter.hasNext() ) condition.append(" 1=1"); //TODO: fix this ugliness while ( iter.hasNext() ) { Expression expr = (Expression) iter.next(); --- 32,36 ---- StringBuffer condition = new StringBuffer(30); Iterator iter = criteria.iterateExpressions(); ! if ( !iter.hasNext() ) condition.append("1=1"); //TODO: fix this ugliness while ( iter.hasNext() ) { Expression expr = (Expression) iter.next(); *************** *** 37,41 **** if ( iter.hasNext() ) condition.append(" and "); } ! renderStatement( condition.toString(), factory ); --- 38,50 ---- if ( iter.hasNext() ) condition.append(" and "); } ! ! iter = criteria.iterateOrderings(); ! if ( iter.hasNext() ) condition.append(" order by "); ! while ( iter.hasNext() ) { ! Order ord = (Order) iter.next(); ! condition.append( ord.toSqlString(factory, criteria.getPersistentClass(), alias) ); ! if ( iter.hasNext() ) condition.append(", "); ! } ! renderStatement( condition.toString(), factory ); |
From: <one...@us...> - 2003-03-09 04:23:36
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/sql Modified Files: QueryJoinFragment.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: QueryJoinFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/QueryJoinFragment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueryJoinFragment.java 1 Mar 2003 06:14:10 -0000 1.2 --- QueryJoinFragment.java 9 Mar 2003 04:04:09 -0000 1.3 *************** *** 78,81 **** --- 78,82 ---- public void addCondition(String condition) { + if ( !condition.startsWith(" and ") ) afterWhere.append(" and "); afterWhere.append(condition); } |
From: <one...@us...> - 2003-03-09 04:23:29
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/impl Modified Files: CriteriaImpl.java QueryImpl.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: CriteriaImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CriteriaImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CriteriaImpl.java 8 Mar 2003 06:39:21 -0000 1.1 --- CriteriaImpl.java 9 Mar 2003 04:04:08 -0000 1.2 *************** *** 9,16 **** --- 9,18 ---- import net.sf.hibernate.HibernateException; import net.sf.hibernate.expression.Expression; + import net.sf.hibernate.expression.Order; public class CriteriaImpl implements Criteria { private List expressions = new ArrayList(); + private List orderings = new ArrayList(); private Integer maxResults; private Integer firstResult; *************** *** 60,63 **** --- 62,69 ---- } + public Iterator iterateOrderings() { + return orderings.iterator(); + } + public Class getPersistentClass() { return persistentClass; *************** *** 66,69 **** --- 72,80 ---- public String toString() { return expressions.toString(); + } + + public Criteria addOrder(Order ordering) { + orderings.add(ordering); + return this; } Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** QueryImpl.java 4 Mar 2003 10:53:46 -0000 1.9 --- QueryImpl.java 9 Mar 2003 04:04:08 -0000 1.10 *************** *** 5,8 **** --- 5,9 ---- import java.math.BigDecimal; import java.util.ArrayList; + import java.util.Arrays; import java.util.Calendar; import java.util.Collection; *************** *** 420,423 **** --- 421,434 ---- } + public Query setParameterList(String name, Object[] vals, Type type) + throws HibernateException { + return setParameterList(name, Arrays.asList(vals), type); + } + + public Query setParameterList(String name, Object[] vals) + throws HibernateException { + return setParameterList( name, Arrays.asList(vals) ); + } + } |
From: <one...@us...> - 2003-03-09 04:04:40
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/hql Modified Files: ParserHelper.java PathExpressionParser.java QueryTranslator.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: ParserHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/ParserHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ParserHelper.java 28 Feb 2003 07:01:28 -0000 1.4 --- ParserHelper.java 9 Mar 2003 04:04:07 -0000 1.5 *************** *** 14,21 **** public static final String PATH_SEPARATORS = "."; ! public static final String whitespace = " \n\r\f\t"; public static boolean isWhitespace(String str) { ! return whitespace.indexOf(str) > -1; } --- 14,21 ---- public static final String PATH_SEPARATORS = "."; ! public static final String WHITESPACE = " \n\r\f\t"; public static boolean isWhitespace(String str) { ! return WHITESPACE.indexOf(str) > -1; } Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PathExpressionParser.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PathExpressionParser.java 3 Mar 2003 09:31:02 -0000 1.13 --- PathExpressionParser.java 9 Mar 2003 04:04:07 -0000 1.14 *************** *** 158,161 **** --- 158,162 ---- addJoin( p.getQualifiedTableName(), name, colNames, q ); + if ( p.hasWhere() ) join.addCondition( p.getSQLWhereString(name) ); doCollectionProperty(token, p, name); collectionName = name; Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** QueryTranslator.java 4 Mar 2003 10:53:46 -0000 1.19 --- QueryTranslator.java 9 Mar 2003 04:04:07 -0000 1.20 *************** *** 15,19 **** import java.util.Map; import java.util.Set; - import java.util.StringTokenizer; import net.sf.hibernate.Hibernate; --- 15,18 ---- *************** *** 669,672 **** --- 668,672 ---- join.addCrossJoin( persister.getQualifiedTableName(), elementName ); join.addCondition(elementName, keyColumnNames, " = ?"); + if ( persister.hasWhere() ) join.addCondition( persister.getSQLWhereString(elementName) ); } else { //many-to-many *************** *** 686,689 **** --- 686,690 ---- JoinFragment.INNER_JOIN ); + if ( persister.hasWhere() ) join.addCondition( persister.getSQLWhereString(collectionName) ); } addFrom(elementName, elemType.getPersistentClass(), join); *************** *** 758,773 **** public static String[] concreteQueries(String query, SessionFactoryImplementor factory) { ! StringTokenizer tokens = new StringTokenizer(query, StringHelper.COMMA_SPACE); ArrayList placeholders = new ArrayList(); ArrayList replacements = new ArrayList(); int count=0; ! boolean check = false; ! while ( tokens.hasMoreTokens() ) { ! String token = tokens.nextToken(); ! if ( "class".equals( token.toLowerCase() ) ) { ! check = true; } ! else if (check) { ! check = false; Class clazz= getImportedClass(token, factory); if (clazz!=null) { --- 759,791 ---- public static String[] concreteQueries(String query, SessionFactoryImplementor factory) { ! //TODO: this is one of the ugliest and most fragile pieces of code in Hibernate.... ! String[] tokens = StringHelper.split( ParserHelper.WHITESPACE + ",", query, true ); ArrayList placeholders = new ArrayList(); ArrayList replacements = new ArrayList(); int count=0; ! String last = null; ! int nextIndex = 0; ! String next = null; ! for ( int i=1; i<tokens.length; i++ ) { ! ! //update last non-whitespace token, if necessary ! if ( !ParserHelper.isWhitespace( tokens[i-1] ) ) last = tokens[i-1].toLowerCase(); ! ! String token = tokens[i]; ! if ( ParserHelper.isWhitespace(token) || last==null ) continue; ! ! //scan for next non-whitespace token ! if (nextIndex<=i) { ! for ( nextIndex=i+1; nextIndex<tokens.length; nextIndex++ ) { ! next = tokens[nextIndex].toLowerCase(); ! if ( !ParserHelper.isWhitespace(next) ) break; ! } } ! ! //if ( Character.isUpperCase( token.charAt( token.lastIndexOf(".") + 1 ) ) ) { ! if ( ! ( beforeClassTokens.contains(last) && !notAfterClassTokens.contains(next) ) || ! "class".equals(last) ! ){ Class clazz= getImportedClass(token, factory); if (clazz!=null) { *************** *** 781,788 **** --- 799,818 ---- } } + } return StringHelper.multiply( query, placeholders.iterator(), replacements.iterator() ); } + private static final Set beforeClassTokens = new HashSet(); + private static final Set notAfterClassTokens = new HashSet(); + static { + beforeClassTokens.add("from"); + beforeClassTokens.add(","); + notAfterClassTokens.add("in"); + notAfterClassTokens.add(","); + notAfterClassTokens.add("from"); + notAfterClassTokens.add(")"); + } + Class getImportedClass(String name) { return getImportedClass(name, factory); *************** *** 793,797 **** return ReflectHelper.classForName(name); } ! catch (Exception e) { String[] imports = factory.getImports(); for (int i=0; i<imports.length; i++) { --- 823,827 ---- return ReflectHelper.classForName(name); } ! catch (Throwable e) { String[] imports = factory.getImports(); for (int i=0; i<imports.length; i++) { *************** *** 799,803 **** return ReflectHelper.classForName( imports[i] + StringHelper.DOT + name ); } ! catch (Exception ex) {} } return null; --- 829,833 ---- return ReflectHelper.classForName( imports[i] + StringHelper.DOT + name ); } ! catch (Throwable t) {} } return null; |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/expression Modified Files: AndExpression.java Expression.java GeExpression.java GtExpression.java LeExpression.java LikeExpression.java LogicalExpression.java LtExpression.java OrExpression.java SQLExpression.java SimpleExpression.java Added Files: BetweenExpression.java InExpression.java NotNullExpression.java NullExpression.java Order.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax --- NEW FILE: BetweenExpression.java --- //$Id: BetweenExpression.java,v 1.1 2003/03/09 04:04:06 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.util.StringHelper; /** * */ public class BetweenExpression extends Expression { private final String propertyName; private final Object lo; private final Object hi; BetweenExpression(String propertyName, Object lo, Object hi) { this.propertyName = propertyName; this.lo = lo; this.hi = hi; } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.SessionFactory) */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { return StringHelper.join( " and ", StringHelper.suffix( getColumns(sessionFactory, persistentClass, propertyName, alias), " between ? and ?" ) ); //TODO: get SQL rendering out of this package! } public TypedValue[] getTypedValues(SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { return new TypedValue[] { getTypedValue(sessionFactory, persistentClass, propertyName, lo), getTypedValue(sessionFactory, persistentClass, propertyName, hi) }; } public String toString() { return propertyName + " between " + lo + " and " + hi; } } --- NEW FILE: InExpression.java --- //$Id: InExpression.java,v 1.1 2003/03/09 04:04:06 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.util.StringHelper; /** * */ public class InExpression extends Expression { private final String propertyName; private final Object[] values; InExpression(String propertyName, Object[] values) { this.propertyName = propertyName; this.values = values; } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.SessionFactory) */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { String params = StringHelper.repeat( "?, ", values.length-1 ); if ( values.length>0 ) params+="?"; return getColumns(sessionFactory, persistentClass, propertyName, alias) + " in (" + params + ')'; //TODO: get SQL rendering out of this package! } public TypedValue[] getTypedValues(SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { TypedValue[] tvs = new TypedValue[ values.length ]; for ( int i=0; i<tvs.length; i++ ) { tvs[i] = getTypedValue( sessionFactory, persistentClass, propertyName, values[i] ); } return tvs; } public String toString() { return propertyName + " in (" + StringHelper.toString(values) + ')'; } } --- NEW FILE: NotNullExpression.java --- //$Id: NotNullExpression.java,v 1.1 2003/03/09 04:04:06 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.util.StringHelper; /** * */ public class NotNullExpression extends Expression { private final String propertyName; private static final TypedValue[] NO_VALUES = new TypedValue[0]; NotNullExpression(String propertyName) { this.propertyName = propertyName; } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.SessionFactory) */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { return StringHelper.join( " and ", StringHelper.suffix( getColumns(sessionFactory, persistentClass, propertyName, alias), " is not null" ) ); //TODO: get SQL rendering out of this package! } public TypedValue[] getTypedValues(SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { return NO_VALUES; } public String toString() { return propertyName + " is not null"; } } --- NEW FILE: NullExpression.java --- //$Id: NullExpression.java,v 1.1 2003/03/09 04:04:06 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.util.StringHelper; /** * */ public class NullExpression extends Expression { private final String propertyName; private static final TypedValue[] NO_VALUES = new TypedValue[0]; NullExpression(String propertyName) { this.propertyName = propertyName; } /** * @see net.sf.hibernate.expression.Expression#toSqlString(net.sf.hibernate.SessionFactory) */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { return StringHelper.join( " and ", StringHelper.suffix( getColumns(sessionFactory, persistentClass, propertyName, alias), " is null" ) ); //TODO: get SQL rendering out of this package! } public TypedValue[] getTypedValues(SessionFactoryImplementor sessionFactory, Class persistentClass) throws HibernateException { return NO_VALUES; } public String toString() { return propertyName + " is null"; } } --- NEW FILE: Order.java --- //$Id: Order.java,v 1.1 2003/03/09 04:04:06 oneovthafew Exp $ package net.sf.hibernate.expression; import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; /** * Represents an order imposed upon a <tt>Criteria</tt> result set */ public class Order { private boolean ascending; private String propertyName; /** * Constructor for Order. */ protected Order(String propertyName, boolean ascending) { this.propertyName = propertyName; this.ascending = ascending; } /** * Render the SQL fragment * * @param sessionFactory * @param persistentClass * @param alias * @return String * @throws HibernateException */ public String toSqlString(SessionFactoryImplementor sessionFactory, Class persistentClass, String alias) throws HibernateException { String[] columns = Expression.getColumns(sessionFactory, persistentClass, propertyName, alias); if (columns.length!=1) throw new HibernateException("Cannot order by multi-column property: " + propertyName); return columns[0] + ( ascending ? " asc" : " desc" ); } /** * Ascending order * * @param propertyName * @return Order */ public static Order asc(String propertyName) { return new Order(propertyName, true); } /** * Descending order * * @param propertyName * @return Order */ public static Order desc(String propertyName) { return new Order(propertyName, false); } } Index: AndExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/AndExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AndExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- AndExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: Expression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/Expression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Expression.java 8 Mar 2003 06:31:22 -0000 1.1 --- Expression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 2,5 **** --- 2,7 ---- package net.sf.hibernate.expression; + import java.util.Collection; + import net.sf.hibernate.HibernateException; import net.sf.hibernate.engine.SessionFactoryImplementor; *************** *** 77,80 **** --- 79,123 ---- } /** + * Apply a "between" constraint to the named property + * @param propertyName + * @param value + * @return Expression + */ + public static Expression between(String propertyName, Object lo, Object hi) { + return new BetweenExpression(propertyName, lo, hi); + } + /** + * Apply an "in" constraint to the named property + * @param propertyName + * @param values + * @return Expression + */ + public static Expression in(String propertyName, Object[] values) { + return new InExpression(propertyName, values); + } + /** + * Apply an "in" constraint to the named property + * @param propertyName + * @param values + * @return Expression + */ + public static Expression in(String propertyName, Collection values) { + return new InExpression( propertyName, values.toArray() ); + } + /** + * Apply an "is null" constraint to the named property + * @return Expression + */ + public static Expression isNull(String propertyName) { + return new NullExpression(propertyName); + } + /** + * Apply an "is not null" constraint to the named property + * @return Expression + */ + public static Expression isNotNull(String propertyName) { + return new NotNullExpression(propertyName); + } + /** * Return the conjuction of two expressions * *************** *** 107,111 **** /** * Apply a constraint expressed in SQL, with the given JDBC ! * parameters * * @param sql --- 150,155 ---- /** * Apply a constraint expressed in SQL, with the given JDBC ! * parameters. Any occurrences of <tt>$alias</tt> will be ! * replaced by the table alias. * * @param sql *************** *** 119,123 **** /** * Apply a constraint expressed in SQL, with the given JDBC ! * parameter * * @param sql --- 163,168 ---- /** * Apply a constraint expressed in SQL, with the given JDBC ! * parameter. Any occurrences of <tt>$alias</tt> will be replaced ! * by the table alias. * * @param sql *************** *** 130,134 **** } /** ! * Apply a constraint expressed in SQL * * @param sql --- 175,180 ---- } /** ! * Apply a constraint expressed in SQL. Any occurrences of <tt>$alias</tt> ! * will be replaced by the table alias. * * @param sql *************** *** 140,144 **** /** ! * Render and SQL fragment * * @param sessionFactory --- 186,190 ---- /** ! * Render the SQL fragment * * @param sessionFactory *************** *** 166,174 **** public abstract String toString(); ! protected String[] getColumns(SessionFactoryImplementor sessionFactory, Class persistentClass, String property, String alias) throws HibernateException { return ( (Queryable) sessionFactory.getPersister(persistentClass) ).toColumns(alias, property); } ! protected TypedValue getTypedValue(SessionFactoryImplementor sessionFactory, Class persistentClass, String propertyName, Object value) throws HibernateException { return new TypedValue( ( (Queryable) sessionFactory.getPersister(persistentClass) ).getPropertyType(propertyName), value ); } --- 212,220 ---- public abstract String toString(); ! protected static String[] getColumns(SessionFactoryImplementor sessionFactory, Class persistentClass, String property, String alias) throws HibernateException { return ( (Queryable) sessionFactory.getPersister(persistentClass) ).toColumns(alias, property); } ! protected static TypedValue getTypedValue(SessionFactoryImplementor sessionFactory, Class persistentClass, String propertyName, Object value) throws HibernateException { return new TypedValue( ( (Queryable) sessionFactory.getPersister(persistentClass) ).getPropertyType(propertyName), value ); } Index: GeExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/GeExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GeExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- GeExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: GtExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/GtExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GtExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- GtExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: LeExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/LeExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LeExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- LeExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: LikeExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/LikeExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LikeExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- LikeExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: LogicalExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/LogicalExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LogicalExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- LogicalExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: LtExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/LtExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LtExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- LtExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: OrExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/OrExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OrExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- OrExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; Index: SQLExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/SQLExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SQLExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- SQLExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import net.sf.hibernate.engine.TypedValue; import net.sf.hibernate.type.Type; + import net.sf.hibernate.util.StringHelper; /** *************** *** 23,27 **** String alias) throws HibernateException { ! return sql; } --- 24,28 ---- String alias) throws HibernateException { ! return StringHelper.replace(sql, "$alias", alias); } Index: SimpleExpression.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/expression/SimpleExpression.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleExpression.java 8 Mar 2003 06:31:22 -0000 1.1 --- SimpleExpression.java 9 Mar 2003 04:04:06 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + //$Id$ package net.sf.hibernate.expression; |
From: <one...@us...> - 2003-03-09 04:04:38
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate/collection Modified Files: CollectionPersister.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CollectionPersister.java 2 Mar 2003 02:17:55 -0000 1.13 --- CollectionPersister.java 9 Mar 2003 04:04:05 -0000 1.14 *************** *** 247,251 **** String token = tokens.nextToken(); if ( Character.isLetter( token.charAt(0) ) && !keywords.contains(token) ) { - //TODO: handle and, or, not result.append(alias).append(StringHelper.DOT).append(token); } --- 247,250 ---- |
From: <one...@us...> - 2003-03-09 04:04:38
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv31647/hibernate Modified Files: Criteria.java Interceptor.java Lifecycle.java Query.java Session.java Log Message: expanded Criteria API allowed unmapped-class queries with new from syntax Index: Criteria.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Criteria.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Criteria.java 8 Mar 2003 06:31:22 -0000 1.1 --- Criteria.java 9 Mar 2003 04:04:04 -0000 1.2 *************** *** 5,11 **** import net.sf.hibernate.expression.Expression; /** ! * <tt>Criteria</tt> is a simplified API for retrieving objects * by composing <tt>Expression</tt> objects. This is a very * convenient approach for functionality like "search" screens --- 5,12 ---- import net.sf.hibernate.expression.Expression; + import net.sf.hibernate.expression.Order; /** ! * <tt>Criteria</tt> is a simplified API for retrieving entities * by composing <tt>Expression</tt> objects. This is a very * convenient approach for functionality like "search" screens *************** *** 13,22 **** * upon the result set.<br> * <br> * In the current implementation, conditions may only be placed * upon properties of the class being retrieved (and its * components). Hibernate's query language is much more general ! * and should be used for non-simple cases. * <br> * <i>This is an experimental API</i> */ public interface Criteria { --- 14,36 ---- * upon the result set.<br> * <br> + * The <tt>Session</tt> is a factory for <tt>Criteria</tt>. + * <tt>Expression</tt> instances are usually obtained via + * the factory methods on <tt>Expression</tt>. eg. + * <pre> + * List cats = session.createCriteria(Cat.class) + * .add( Expression.like("name", "Iz%") ) + * .add( Expression.gt( "weight", new Float(minWeight) ) ) + * .addOrder( Order.asc("age") ) + * .list(); + * </pre> * In the current implementation, conditions may only be placed * upon properties of the class being retrieved (and its * components). Hibernate's query language is much more general ! * and should be used for non-simple cases.<br> * <br> * <i>This is an experimental API</i> + * + * @see Session#createCriteria(java.lang.Class) + * @see net.sf.hibernate.expression.Expression */ public interface Criteria { *************** *** 50,53 **** --- 64,75 ---- */ public Criteria add(Expression expression); + + /** + * An an <tt>Order</tt> to the result set + * + * @param order + * @return Criteria + */ + public Criteria addOrder(Order order); /** * Get the results Index: Interceptor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Interceptor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Interceptor.java 28 Jan 2003 10:22:18 -0000 1.6 --- Interceptor.java 9 Mar 2003 04:04:04 -0000 1.7 *************** *** 20,24 **** * * @see SessionFactory#openSession(Interceptor) ! * @see net.sf.hibernate.cfg.Configuration#buildSessionFactory(Interceptor) */ public interface Interceptor { --- 20,24 ---- * * @see SessionFactory#openSession(Interceptor) ! * @see net.sf.hibernate.cfg.Configuration#setInterceptor(Interceptor) */ public interface Interceptor { Index: Lifecycle.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Lifecycle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Lifecycle.java 5 Jan 2003 02:11:19 -0000 1.3 --- Lifecycle.java 9 Mar 2003 04:04:05 -0000 1.4 *************** *** 9,13 **** * required to.<br> * <br> ! * <b>onSave:</b> called just before the object is saved or inserted<br> * <b>onUpdate:</b> called just before an object is updated, * ie. when <tt>Session.update()</tt> is called<br> --- 9,13 ---- * required to.<br> * <br> ! * <b>onSave:</b> called just before the object is saved<br> * <b>onUpdate:</b> called just before an object is updated, * ie. when <tt>Session.update()</tt> is called<br> *************** *** 34,38 **** * <br> * Note that <tt>onSave()</tt> is called after an identifier is assigned ! * to the object, except when native key generation is used. * @see CallbackException */ --- 34,38 ---- * <br> * Note that <tt>onSave()</tt> is called after an identifier is assigned ! * to the object, except when identity column key generation is used. * @see CallbackException */ Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Query.java 4 Mar 2003 10:53:46 -0000 1.8 --- Query.java 9 Mar 2003 04:04:05 -0000 1.9 *************** *** 180,183 **** --- 180,201 ---- /** + * Bind multiple values to a named query parameter. This is useful for binding + * a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>. + * @param name the name of the parameter + * @param vals a collection of values to list + * @param type the Hibernate type of the values + */ + public Query setParameterList(String name, Object[] vals, Type type) throws HibernateException; + + /** + * Bind multiple values to a named query parameter, guessing the Hibernate type from the + * class of the first object in the array. This is useful for binding a list of values + * to an expression such as <tt>foo.bar in (:value_list)</tt>. + * @param name the name of the parameter + * @param vals a collection of values to list + */ + public Query setParameterList(String name, Object[] vals) throws HibernateException; + + /** * Bind the property values of the given bean to named parameters of the query, * matching property names with parameter names and mapping property types to Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Session.java 8 Mar 2003 06:31:22 -0000 1.10 --- Session.java 9 Mar 2003 04:04:05 -0000 1.11 *************** *** 466,469 **** --- 466,476 ---- public Transaction beginTransaction() throws HibernateException; + /** + * Create a new <tt>Criteria</tt> instance, for the given + * entity class + * + * @param persistentClass + * @return Criteria + */ public Criteria createCriteria(Class persistentClass); |
From: <db...@us...> - 2003-03-08 09:53:40
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca In directory sc8-pr-cvs1:/tmp/cvs-serv15631/src/net/sf/hibernate/jca Modified Files: JCASessionImpl.java MetaDataImpl.java LocalTransactionImpl.java JCASessionFactoryImpl.java ManagedConnectionImpl.java ConnectionRequestInfoImpl.java hibernate-service.xml ManagedConnectionFactoryImpl.java Log Message: *** keyword substitution change *** Index: JCASessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Index: MetaDataImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/MetaDataImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Index: LocalTransactionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/LocalTransactionImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Index: JCASessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Index: ManagedConnectionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/ManagedConnectionImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Index: ConnectionRequestInfoImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/ConnectionRequestInfoImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Index: hibernate-service.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/hibernate-service.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Index: ManagedConnectionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/ManagedConnectionFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 |
From: <one...@us...> - 2003-03-08 06:41:48
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv18968 Modified Files: build.xml Log Message: added new criteria + expression API (experimental) Index: build.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build.xml 2 Mar 2003 15:30:23 -0000 1.9 --- build.xml 8 Mar 2003 06:41:45 -0000 1.10 *************** *** 152,156 **** <javadoc sourcepath="${src.dir}" ! packagenames="net.sf.hibernate,net.sf.hibernate.id,net.sf.hibernate.connection,net.sf.hibernate.transaction,net.sf.hibernate.type,net.sf.hibernate.dialect,net.sf.hibernate.odmg,net.sf.hibernate.cfg,net.sf.hibernate.cache,net.sf.hibernate.jmx,net.sf.hibernate.loader,net.sf.hibernate.persister,net.sf.hibernate.engine,net.sf.hibernate.metadata,net.sf.hibernate.mapping" classpathref="lib.class.path" destdir="${dist.api.dir}" --- 152,156 ---- <javadoc sourcepath="${src.dir}" ! packagenames="net.sf.hibernate,net.sf.hibernate.expression,net.sf.hibernate.id,net.sf.hibernate.connection,net.sf.hibernate.transaction,net.sf.hibernate.type,net.sf.hibernate.dialect,net.sf.hibernate.odmg,net.sf.hibernate.cfg,net.sf.hibernate.cache,net.sf.hibernate.jmx,net.sf.hibernate.loader,net.sf.hibernate.persister,net.sf.hibernate.engine,net.sf.hibernate.metadata,net.sf.hibernate.mapping" classpathref="lib.class.path" destdir="${dist.api.dir}" *************** *** 164,168 **** link="${javadoc}"> ! <group title="Core API" packages="net.sf.hibernate:net.sf.hibernate.metadata:net.sf.hibernate.cfg"/> <group title="Extension API" packages="net.sf.hibernate.id:net.sf.hibernate.connection:net.sf.hibernate.transaction:net.sf.hibernate.type:net.sf.hibernate.dialect:net.sf.hibernate.cache:net.sf.hibernate.loader:net.sf.hibernate.persister:net.sf.hibernate.engine"/> <group title="Miscellaneous API" packages="net.sf.hibernate.odmg:net.sf.hibernate.jmx:net.sf.hibernate.mapping"/> --- 164,168 ---- link="${javadoc}"> ! <group title="Core API" packages="net.sf.hibernate:net.sf.hibernate.expression:net.sf.hibernate.metadata:net.sf.hibernate.cfg"/> <group title="Extension API" packages="net.sf.hibernate.id:net.sf.hibernate.connection:net.sf.hibernate.transaction:net.sf.hibernate.type:net.sf.hibernate.dialect:net.sf.hibernate.cache:net.sf.hibernate.loader:net.sf.hibernate.persister:net.sf.hibernate.engine"/> <group title="Miscellaneous API" packages="net.sf.hibernate.odmg:net.sf.hibernate.jmx:net.sf.hibernate.mapping"/> |
From: <one...@us...> - 2003-03-08 06:39:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv15856/sf/hibernate/impl Modified Files: SessionImpl.java Log Message: added new criteria + expression API (experimental) Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SessionImpl.java 6 Mar 2003 11:11:53 -0000 1.24 --- SessionImpl.java 8 Mar 2003 06:31:22 -0000 1.25 *************** *** 25,28 **** --- 25,29 ---- import net.sf.hibernate.AssertionFailure; + import net.sf.hibernate.Criteria; import net.sf.hibernate.FlushMode; import net.sf.hibernate.HibernateException; *************** *** 52,56 **** import net.sf.hibernate.collection.ArrayHolder; import net.sf.hibernate.engine.*; ! import net.sf.hibernate.loader.SearchLoader; import net.sf.hibernate.persister.ClassPersister; import net.sf.hibernate.persister.Loadable; --- 53,57 ---- import net.sf.hibernate.collection.ArrayHolder; import net.sf.hibernate.engine.*; ! import net.sf.hibernate.loader.CriteriaLoader; import net.sf.hibernate.persister.ClassPersister; import net.sf.hibernate.persister.Loadable; *************** *** 2846,2865 **** } ! public List find(Class persistentClass, Map propertyNameValues) throws HibernateException { if ( log.isTraceEnabled() ) { log.trace( "search: " + persistentClass.getName() ); ! log.trace( "properties: " + propertyNameValues ); } - String[] propertyNames = new String[ propertyNameValues.size() ]; - Iterator iter = propertyNameValues.keySet().iterator(); - for ( int i=0; i<propertyNameValues.size(); i++ ) { - propertyNames[i] = (String) iter.next(); - } Loadable persister = (Loadable) getPersister(persistentClass); ! SearchLoader loader = new SearchLoader(persister, factory, propertyNames); ! Serializable[] spaces = persister.getPropertySpaces(); Set set = new HashSet(); --- 2847,2867 ---- } ! public Criteria createCriteria(Class persistentClass) { ! return new CriteriaImpl(persistentClass, this); ! } ! ! ! public List find(CriteriaImpl criteria) throws HibernateException { + Class persistentClass = criteria.getPersistentClass(); + if ( log.isTraceEnabled() ) { log.trace( "search: " + persistentClass.getName() ); ! log.trace( "criteria: " + criteria ); } Loadable persister = (Loadable) getPersister(persistentClass); ! CriteriaLoader loader = new CriteriaLoader(persister, factory, criteria); Serializable[] spaces = persister.getPropertySpaces(); Set set = new HashSet(); *************** *** 2869,2873 **** dontFlushFromFind++; try { ! return loader.list(this, propertyNameValues); } catch (SQLException sqle) { --- 2871,2875 ---- dontFlushFromFind++; try { ! return loader.list(this); } catch (SQLException sqle) { |