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-25 02:21:12
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv25122/cirrus/hibernate/loader
Modified Files:
AnsiOuterJoinGenerator.java OracleOuterJoinGenerator.java
OuterJoinGenerator.java
Log Message:
use OuterJoinGenerator for normalized table mappings
Index: AnsiOuterJoinGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/AnsiOuterJoinGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AnsiOuterJoinGenerator.java 5 Nov 2002 03:44:01 -0000 1.4
--- AnsiOuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.5
***************
*** 15,40 ****
}
! /**
! * Generate a <tt>LEFT OUTER JOIN</tt> clause to the table of the entity class
! */
! protected final String appendOuterJoinStringAfterFrom(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc) {
! StringBuffer on = new StringBuffer(20).append("ON ");
! String[] keyNames = assoc.subpersister.getIdentifierColumnNames();
//TODO: refactor onto Loadable .. this is repeated in two other places
! for ( int j=0; j<assoc.foreignKeyColumns.length; j++) {
! on.append( assoc.foreignKeyColumns[j] )
.append('=')
! .append(assoc.subalias)
.append('.')
! .append( keyNames[j] );
! if ( j<assoc.foreignKeyColumns.length-1 ) on.append(" and ");
}
- buf.append(" LEFT OUTER JOIN ")
- .append( assoc.subpersister.fromClauseFragment( assoc.subalias, on.toString() ) );
return buf.toString();
}
! protected final String appendOuterJoinStringAfterWhere(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc) {
return EMPTY_STRING;
}
--- 15,38 ----
}
! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns) {
! buf.append(" LEFT OUTER JOIN ")
! .append(tableName)
! .append(' ')
! .append(alias)
! .append(" ON ");
//TODO: refactor onto Loadable .. this is repeated in two other places
! for ( int j=0; j<fkColumns.length; j++) {
! buf.append( fkColumns[j] )
.append('=')
! .append(alias)
.append('.')
! .append( pkColumns[j] );
! if ( j<fkColumns.length-1 ) buf.append(" and ");
}
return buf.toString();
}
! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns) {
return EMPTY_STRING;
}
Index: OracleOuterJoinGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OracleOuterJoinGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** OracleOuterJoinGenerator.java 4 Nov 2002 08:10:50 -0000 1.4
--- OracleOuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.5
***************
*** 13,41 ****
}
! /**
! * Generate a <tt>LEFT OUTER JOIN</tt> clause to the table of the entity class
! */
! protected final String appendOuterJoinStringAfterFrom(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc) {
buf.append(", ")
! .append( assoc.subpersister.getTableName() )
.append(' ')
! .append(assoc.subalias );
return buf.toString();
}
! protected final String appendOuterJoinStringAfterWhere(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc) {
! String[] keyNames = assoc.subpersister.getIdentifierColumnNames();
! for ( int j=0; j<assoc.foreignKeyColumns.length; j++) {
buf.append(" AND ")
! .append( assoc.foreignKeyColumns[j] )
.append('=')
! .append(assoc.subalias)
.append('.')
! .append( keyNames[j] )
.append("(+)");
}
return buf.toString();
}
}
--- 13,38 ----
}
! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns) {
buf.append(", ")
! .append(tableName)
.append(' ')
! .append(alias);
return buf.toString();
}
! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns) {
! for ( int j=0; j<fkColumns.length; j++) {
buf.append(" AND ")
! .append( fkColumns[j] )
.append('=')
! .append(alias)
.append('.')
! .append( pkColumns[j] )
.append("(+)");
}
return buf.toString();
}
+
}
Index: OuterJoinGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OuterJoinGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OuterJoinGenerator.java 5 Nov 2002 03:44:01 -0000 1.3
--- OuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.4
***************
*** 19,23 ****
StringBuffer buf = new StringBuffer(50);
Iterator iter = associations.iterator();
! while ( iter.hasNext() ) appendOuterJoinStringAfterFrom(buf, (OuterJoinLoader.OuterJoinableAssociation) iter.next());
return buf.toString();
}
--- 19,33 ----
StringBuffer buf = new StringBuffer(50);
Iterator iter = associations.iterator();
! while ( iter.hasNext() ) {
! OuterJoinLoader.OuterJoinableAssociation oj = (OuterJoinLoader.OuterJoinableAssociation) iter.next();
! appendOuterJoinStringAfterFrom(
! buf,
! oj.subpersister.getTableName(),
! oj.subalias,
! oj.foreignKeyColumns,
! oj.subpersister.getIdentifierColumnNames()
! );
! buf.append( oj.subpersister.outerJoinsAfterFrom(oj.subalias) );
! }
return buf.toString();
}
***************
*** 30,34 ****
StringBuffer buf = new StringBuffer(50);
Iterator iter = associations.iterator();
! while ( iter.hasNext() ) appendOuterJoinStringAfterWhere(buf, (OuterJoinLoader.OuterJoinableAssociation) iter.next());
return buf.toString();
}
--- 40,53 ----
StringBuffer buf = new StringBuffer(50);
Iterator iter = associations.iterator();
! while ( iter.hasNext() ) {
! OuterJoinLoader.OuterJoinableAssociation oj = (OuterJoinLoader.OuterJoinableAssociation) iter.next();
! appendOuterJoinStringAfterWhere(
! buf,
! oj.subalias,
! oj.foreignKeyColumns,
! oj.subpersister.getIdentifierColumnNames()
! );
! buf.append( oj.subpersister.outerJoinsAfterWhere(oj.subalias) );
! }
return buf.toString();
}
***************
*** 38,42 ****
* To be inserted after the FROM clause.
*/
! protected abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc);
/**
--- 57,61 ----
* To be inserted after the FROM clause.
*/
! public abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns);
/**
***************
*** 44,48 ****
* To be inserted after the FROM clause.
*/
! protected abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, OuterJoinLoader.OuterJoinableAssociation assoc);
}
--- 63,67 ----
* To be inserted after the FROM clause.
*/
! public abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns);
}
|
|
From: <one...@us...> - 2002-11-25 02:21:12
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv25122 Modified Files: changelog.txt hibernate.properties Log Message: use OuterJoinGenerator for normalized table mappings Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.273 retrieving revision 1.274 diff -C2 -d -r1.273 -r1.274 *** changelog.txt 24 Nov 2002 15:45:49 -0000 1.273 --- changelog.txt 25 Nov 2002 02:21:08 -0000 1.274 *************** *** 3,7 **** Changes in version 1.2 beta 3 (26.11.2002) ------------------------------------------ ! * fixed bug in UPDATE SQL generation for normalized mapping strategy (fix by Robson Miranda) * support <composite-id> correctly in CodeGenerator (patch by Tom Cellucci) * fixed an exception that occurred with short qualified tablenames --- 3,7 ---- Changes in version 1.2 beta 3 (26.11.2002) ------------------------------------------ ! * fixed bug in UPDATE SQL generation for <joined-subclass> mapping strategy (fix by Robson Miranda) * support <composite-id> correctly in CodeGenerator (patch by Tom Cellucci) * fixed an exception that occurred with short qualified tablenames *************** *** 21,24 **** --- 21,25 ---- * database reverse engineering GUI tool contributed by Tom Cellucci * SchemaExport now generates column in mapping file order (rather than alphabetical order) + * <joined-subclass> mappings working on Oracle (?) Changes in version 1.2 beta 2 (15.11.2002) Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate/hibernate.properties,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** hibernate.properties 24 Nov 2002 16:19:04 -0000 1.89 --- hibernate.properties 25 Nov 2002 02:21:08 -0000 1.90 *************** *** 129,135 **** ## Interbase ! hibernate.dialect cirrus.hibernate.sql.InterbaseDialect ! hibernate.connection.username sysdba ! hibernate.connection.password masterkey ## DO NOT specify hibernate.connection.sqlDialect --- 129,135 ---- ## Interbase ! #hibernate.dialect cirrus.hibernate.sql.InterbaseDialect ! #hibernate.connection.username sysdba ! #hibernate.connection.password masterkey ## DO NOT specify hibernate.connection.sqlDialect *************** *** 142,147 **** ## Pure Java ! hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver ! hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb --- 142,147 ---- ## Pure Java ! #hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver ! #hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb |
|
From: <one...@us...> - 2002-11-24 16:19:06
|
Update of /cvsroot/hibernate/Hibernate/doc In directory sc8-pr-cvs1:/tmp/cvs-serv27296/doc Modified Files: hibernate.aft hibernate.html links.aft links.html Log Message: minor changes Index: hibernate.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/hibernate.aft,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** hibernate.aft 11 Nov 2002 11:30:00 -0000 1.27 --- hibernate.aft 24 Nov 2002 16:19:04 -0000 1.28 *************** *** 56,66 **** 1. Some features of the query language are not supported for databases which do not have subqueries. ! 2. Firebird InterClient 2.01 is _strongly_ recommended in preference to other versions of Interbase Interclient. * http://www.ibphoenix.com ! 3. Microsoft SQL Server does not ship with a JDBC driver. The free driver available at microsoft.com is _not_ supported. Various third party drivers are available, some (but not all) of which _do_ work. The following drivers are known to work: * JSQL http://www.j-netdirect.com * JTurbo http://www.newatlanta.com/products/jturbo * Weblogic jDriver http://www.bea.com/products/weblogic/drivers.shtml ! 4. MySQL support is via the connector/j (mm-mysql) driver. The Caucho driver does _not_ work. * http://www.mysql.com --- 56,67 ---- 1. Some features of the query language are not supported for databases which do not have subqueries. ! 2. The table-per-subclass mapping strategy is supported only for databases with ANSI-style |OUTER JOIN| and |CASE| ! 3. Firebird InterClient 2.01 is _strongly_ recommended in preference to other versions of Interbase Interclient. * http://www.ibphoenix.com ! 4. Microsoft SQL Server does not ship with a JDBC driver. The free driver available at microsoft.com is _not_ supported. Various third party drivers are available, some (but not all) of which _do_ work. The following drivers are known to work: * JSQL http://www.j-netdirect.com * JTurbo http://www.newatlanta.com/products/jturbo * Weblogic jDriver http://www.bea.com/products/weblogic/drivers.shtml ! 5. MySQL support is via the connector/j (mm-mysql) driver. The Caucho driver does _not_ work. * http://www.mysql.com Index: hibernate.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/hibernate.html,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** hibernate.html 11 Nov 2002 16:04:55 -0000 1.33 --- hibernate.html 24 Nov 2002 16:19:04 -0000 1.34 *************** *** 95,98 **** --- 95,99 ---- <ol> <li> Some features of the query language are not supported for databases which do not have subqueries.</li> + <li> The table-per-subclass mapping strategy is supported only for databases with ANSI-style <tt>OUTER JOIN</tt> and <tt>CASE</tt></li> <li> Firebird InterClient 2.01 is <strong>strongly</strong> recommended in preference to other versions of Interbase Interclient.</li> <ul> Index: links.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/links.aft,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** links.aft 10 Nov 2002 03:40:55 -0000 1.3 --- links.aft 24 Nov 2002 16:19:04 -0000 1.4 *************** *** 38,41 **** --- 38,45 ---- * http://www.opensymphony.com/webwork/ + Maverick is another great MVC framework that works particularly well with Hibernate + + * http://mav.sourceforge.net/ + JBoss is a free application server with JMX Index: links.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/links.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** links.html 10 Nov 2002 03:40:55 -0000 1.3 --- links.html 24 Nov 2002 16:19:04 -0000 1.4 *************** *** 63,66 **** --- 63,72 ---- </ul> <p class="Body"> + Maverick is another great MVC framework that works particularly well with Hibernate + </p> + <ul> + <li> <a href="http://mav.sourceforge.net">http://mav.sourceforge.net</a>/</li> + </ul> + <p class="Body"> JBoss is a free application server with JMX </p> |
|
From: <one...@us...> - 2002-11-24 16:19:06
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv27296 Modified Files: hibernate.properties Log Message: minor changes Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate/hibernate.properties,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** hibernate.properties 24 Nov 2002 13:02:30 -0000 1.88 --- hibernate.properties 24 Nov 2002 16:19:04 -0000 1.89 *************** *** 129,135 **** ## Interbase ! #hibernate.dialect cirrus.hibernate.sql.InterbaseDialect ! #hibernate.connection.username sysdba ! #hibernate.connection.password masterkey ## DO NOT specify hibernate.connection.sqlDialect --- 129,135 ---- ## Interbase ! hibernate.dialect cirrus.hibernate.sql.InterbaseDialect ! hibernate.connection.username sysdba ! hibernate.connection.password masterkey ## DO NOT specify hibernate.connection.sqlDialect *************** *** 142,147 **** ## Pure Java ! #hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver ! #hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb --- 142,147 ---- ## Pure Java ! hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver ! hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb |
|
From: <one...@us...> - 2002-11-24 15:46:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv4213/cirrus/hibernate/test
Modified Files:
FooBarTest.java
Log Message:
property of component type may now appear in select clause
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.228
retrieving revision 1.229
diff -C2 -d -r1.228 -r1.229
*** FooBarTest.java 24 Nov 2002 12:53:21 -0000 1.228
--- FooBarTest.java 24 Nov 2002 15:45:50 -0000 1.229
***************
*** 849,853 ****
assertTrue(count!=0);
list = s.find("select avg(foo.float), max(foo.component.name), count(distinct foo.id) from foo in class Foo");
! //s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work!
s.save( new Holder("ice T") );
--- 849,874 ----
assertTrue(count!=0);
list = s.find("select avg(foo.float), max(foo.component.name), count(distinct foo.id) from foo in class Foo");
! rs = list.iterator();
! count=0;
! while ( rs.hasNext() ) {
! count++;
! Object[] row = (Object[]) rs.next();
! assertTrue( row[0] instanceof Float );
! assertTrue( row[1] instanceof String );
! assertTrue( row[2] instanceof Integer );
! }
! assertTrue(count!=0);
! list = s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work!
! rs = list.iterator();
! count=0;
! while ( rs.hasNext() ) {
! count++;
! Object[] row = (Object[]) rs.next();
! assertTrue( row[0] instanceof Long );
! assertTrue( row[1] instanceof FooComponent );
! assertTrue( row[2] instanceof Foo );
! assertTrue( row[3] instanceof Foo );
! }
! assertTrue(count!=0);
s.save( new Holder("ice T") );
|
|
From: <one...@us...> - 2002-11-24 15:46:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister
In directory sc8-pr-cvs1:/tmp/cvs-serv4213/cirrus/hibernate/persister
Modified Files:
EntityPersister.java MultiTableEntityPersister.java
Log Message:
property of component type may now appear in select clause
Index: EntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** EntityPersister.java 5 Nov 2002 11:48:08 -0000 1.38
--- EntityPersister.java 24 Nov 2002 15:45:50 -0000 1.39
***************
*** 926,947 ****
}
}
else {
! Iterator iter = prop.getColumnIterator();
! String[] names = new String[ prop.getColumnSpan() ];
! int k=0;
! while ( iter.hasNext() ) {
! names[k] = ( (Column) iter.next() ).getName();
! k++;
! }
!
! Type type = prop.getType();
! typesByPropertyPath.put(path, type);
! if ( type.isEntityType() && ( (EntityType) type ).isOneToOne() ) {
! columnNamesByPropertyPath.put( path, getIdentifierColumnNames() );
! }
! else {
! columnNamesByPropertyPath.put(path, names);
! }
!
}
--- 926,945 ----
}
}
+
+ Iterator iter = prop.getColumnIterator();
+ String[] names = new String[ prop.getColumnSpan() ];
+ int k=0;
+ while ( iter.hasNext() ) {
+ names[k] = ( (Column) iter.next() ).getName();
+ k++;
+ }
+
+ Type type = prop.getType();
+ typesByPropertyPath.put(path, type);
+ if ( type.isEntityType() && ( (EntityType) type ).isOneToOne() ) {
+ columnNamesByPropertyPath.put( path, getIdentifierColumnNames() );
+ }
else {
! columnNamesByPropertyPath.put(path, names);
}
***************
*** 1002,1008 ****
String[] cols = getPropertyColumnNames(property);
! if (cols==null) throw new QueryException(
! "unresolved property: " + property + " (possibly need to dereference a component)"
! );
if (cols.length==0) {
--- 1000,1004 ----
String[] cols = getPropertyColumnNames(property);
! if (cols==null) throw new QueryException("unresolved property: " + property);
if (cols.length==0) {
Index: MultiTableEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** MultiTableEntityPersister.java 22 Nov 2002 00:27:09 -0000 1.33
--- MultiTableEntityPersister.java 24 Nov 2002 15:45:50 -0000 1.34
***************
*** 1135,1163 ****
}
}
else {
! Iterator iter = prop.getColumnIterator();
! String[] names = new String[ prop.getColumnSpan() ];
! int k=0;
! while ( iter.hasNext() ) {
! names[k] = ( (Column) iter.next() ).getName();
! k++;
! }
!
! tableNumberByPropertyPath.put(
! path,
! new Integer( getTableId(
! prop.getValue().getTable().getQualifiedName( factory.getDefaultSchema() ),
! subclassTableNameClosure
! ) )
! );
!
! Type type = prop.getType();
! typesByPropertyPath.put(path, type);
! if ( type.isEntityType() && ( (EntityType) type ).isOneToOne() ) {
! columnNamesByPropertyPath.put( path, getIdentifierColumnNames() );
! }
! else {
! columnNamesByPropertyPath.put(path, names);
! }
}
--- 1135,1162 ----
}
}
+
+ Iterator iter = prop.getColumnIterator();
+ String[] names = new String[ prop.getColumnSpan() ];
+ int k=0;
+ while ( iter.hasNext() ) {
+ names[k] = ( (Column) iter.next() ).getName();
+ k++;
+ }
+
+ tableNumberByPropertyPath.put(
+ path,
+ new Integer( getTableId(
+ prop.getValue().getTable().getQualifiedName( factory.getDefaultSchema() ),
+ subclassTableNameClosure
+ ) )
+ );
+
+ Type type = prop.getType();
+ typesByPropertyPath.put(path, type);
+ if ( type.isEntityType() && ( (EntityType) type ).isOneToOne() ) {
+ columnNamesByPropertyPath.put( path, getIdentifierColumnNames() );
+ }
else {
! columnNamesByPropertyPath.put(path, names);
}
***************
*** 1243,1249 ****
String[] cols = getPropertyColumnNames(property);
! if (cols==null) throw new QueryException(
! "unresolved property: " + property + " (possibly you need to dereference a component)"
! );
if (cols.length==0) {
--- 1242,1246 ----
String[] cols = getPropertyColumnNames(property);
! if (cols==null) throw new QueryException("unresolved property: " + property);
if (cols.length==0) {
|
|
From: <one...@us...> - 2002-11-24 15:46:23
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv4213 Modified Files: changelog.txt Log Message: property of component type may now appear in select clause Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.272 retrieving revision 1.273 diff -C2 -d -r1.272 -r1.273 *** changelog.txt 24 Nov 2002 13:02:30 -0000 1.272 --- changelog.txt 24 Nov 2002 15:45:49 -0000 1.273 *************** *** 16,19 **** --- 16,20 ---- * added calendar and calendar_date types * find() queries may now return scalar values + * component-type properties may appear in a select clause * ConnectionProviders now set isolation level before toggle autocommit * Iterator.next() now throws NoSuchElementException as per Iterator contract (fix by Alex Staubo) |
|
From: <one...@us...> - 2002-11-24 15:45:56
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4213/doc/reference/src
Modified Files:
query_language.xml
Log Message:
property of component type may now appear in select clause
Index: query_language.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/query_language.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** query_language.xml 24 Nov 2002 10:55:26 -0000 1.22
--- query_language.xml 24 Nov 2002 15:45:53 -0000 1.23
***************
*** 56,60 ****
<para>
! You may select any property (not just associations):
</para>
--- 56,60 ----
<para>
! Queries may return properties any value type including properties of component type:
</para>
***************
*** 72,82 ****
<para>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <literal>select</literal> clause.
</para>
! <programlisting><![CDATA[select cat.name, cat.mate.name from cat in class eg.Cat
!
! select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
--- 72,80 ----
<para>
! Queryies may even return aggregate functions of properties. Collections may also appear
! inside aggregate functions in the <literal>select</literal> clause.
</para>
! <programlisting><![CDATA[select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
|
|
From: <one...@us...> - 2002-11-24 15:45:56
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html_single
In directory sc8-pr-cvs1:/tmp/cvs-serv4213/doc/reference/html_single
Modified Files:
index.html
Log Message:
property of component type may now appear in select clause
Index: index.html
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html_single/index.html,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** index.html 24 Nov 2002 10:55:26 -0000 1.83
--- index.html 24 Nov 2002 15:45:51 -0000 1.84
***************
*** 2567,2571 ****
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! You may select any property (not just associations):
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
--- 2567,2571 ----
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! Queries may return properties any value type including properties of component type:
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
***************
*** 2575,2583 ****
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <tt>select</tt> clause.
! </p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
!
! select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
--- 2575,2581 ----
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queryies may even return aggregate functions of properties. Collections may also appear
! inside aggregate functions in the <tt>select</tt> clause.
! </p><pre class="programlisting">select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
|
|
From: <one...@us...> - 2002-11-24 15:45:54
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html
In directory sc8-pr-cvs1:/tmp/cvs-serv4213/doc/reference/html
Modified Files:
query-language.html
Log Message:
property of component type may now appear in select clause
Index: query-language.html
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/query-language.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** query-language.html 24 Nov 2002 10:55:26 -0000 1.22
--- query-language.html 24 Nov 2002 15:45:50 -0000 1.23
***************
*** 22,26 ****
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! You may select any property (not just associations):
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
--- 22,26 ----
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! Queries may return properties any value type including properties of component type:
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
***************
*** 30,38 ****
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <tt>select</tt> clause.
! </p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
!
! select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
--- 30,36 ----
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queryies may even return aggregate functions of properties. Collections may also appear
! inside aggregate functions in the <tt>select</tt> clause.
! </p><pre class="programlisting">select avg(cat.weight), sum(cat.weight), max(cat.weight), count(cat)
from cat in class eg.Cat
|
|
From: <one...@us...> - 2002-11-24 13:02:33
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv1318 Modified Files: changelog.txt hibernate.properties readme.txt todo.txt Log Message: version 1.2 beta 3 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** changelog.txt 24 Nov 2002 06:30:11 -0000 1.271 --- changelog.txt 24 Nov 2002 13:02:30 -0000 1.272 *************** *** 1,5 **** Hibernate Changelog =================== ! Changes in version 1.2 beta 3 (21.11.2002) ------------------------------------------ * fixed bug in UPDATE SQL generation for normalized mapping strategy (fix by Robson Miranda) --- 1,5 ---- Hibernate Changelog =================== ! Changes in version 1.2 beta 3 (26.11.2002) ------------------------------------------ * fixed bug in UPDATE SQL generation for normalized mapping strategy (fix by Robson Miranda) *************** *** 19,22 **** --- 19,23 ---- * Iterator.next() now throws NoSuchElementException as per Iterator contract (fix by Alex Staubo) * database reverse engineering GUI tool contributed by Tom Cellucci + * SchemaExport now generates column in mapping file order (rather than alphabetical order) Changes in version 1.2 beta 2 (15.11.2002) Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate/hibernate.properties,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** hibernate.properties 2 Nov 2002 14:32:12 -0000 1.87 --- hibernate.properties 24 Nov 2002 13:02:30 -0000 1.88 *************** *** 140,144 **** #hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb ! ## Pure Java (not supported!) #hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver --- 140,144 ---- #hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb ! ## Pure Java #hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver *************** *** 161,165 **** hibernate.connection.pool_size 2 ! hibernate.statement_cache.size 100 --- 161,165 ---- hibernate.connection.pool_size 2 ! #hibernate.statement_cache.size 100 Index: readme.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/readme.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** readme.txt 14 Nov 2002 12:57:37 -0000 1.51 --- readme.txt 24 Nov 2002 13:02:30 -0000 1.52 *************** *** 1,5 **** Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2 beta 2 15 November 2002 Instructions --- 1,5 ---- Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2 beta 3 26 November 2002 Instructions Index: todo.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/todo.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** todo.txt 5 Nov 2002 13:40:53 -0000 1.26 --- todo.txt 24 Nov 2002 13:02:30 -0000 1.27 *************** *** 1,4 **** --- 1,5 ---- TODO ==== + * support for normalized table mappings in Oracle * immediate deep fetching for queries * allow version numbers to be tracked by persistence layer, not persistent objects (make property optional) |
|
From: <one...@us...> - 2002-11-24 12:53:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv27087/cirrus/hibernate/test
Modified Files:
FooBarTest.java
Log Message:
got tests working on MySQL again
SchemaExport generates columns in the mapping-file order
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.227
retrieving revision 1.228
diff -C2 -d -r1.227 -r1.228
*** FooBarTest.java 23 Nov 2002 01:16:21 -0000 1.227
--- FooBarTest.java 24 Nov 2002 12:53:21 -0000 1.228
***************
*** 644,652 ****
Session s = sessions.openSession();
! s.iterate("from bz in class Baz where bz.setArray[0].size=0");
! s.iterate("from bz in class Baz where not 'foo' in bz.setArray[0].elements");
! s.iterate("from bz in class Baz where 3 in bz.stringArrayMap['foo'].indices");
! s.iterate("from bz in class Baz where bz.stringArrayMap['foo'][0] = 'foo'");
! //s.iterate("from bz in class Baz where bz.components[1].name='foo'");
Bar bar = new Bar();
--- 644,655 ----
Session s = sessions.openSession();
! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof HSQLDialect) && !(dialect instanceof MckoiDialect) && !(dialect instanceof SAPDBDialect) && !(dialect instanceof PointbaseDialect) ) {
! s.iterate("from bz in class Baz where bz.setArray[0].size=0");
! s.iterate("from bz in class Baz where not 'foo' in bz.setArray[0].elements");
! s.iterate("from bz in class Baz where 3 in bz.stringArrayMap['foo'].indices");
! }
! s.iterate("from bz in class Baz where bz.stringArrayMap['foo'][0] = 'foo'");
! //s.iterate("from bz in class Baz where bz.components[1].name='foo'");
!
Bar bar = new Bar();
***************
*** 845,849 ****
}
assertTrue(count!=0);
! list = s.find("select avg(foo.long), max(foo.component.name), count(distinct foo.id) from foo in class Foo");
//s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work!
--- 848,852 ----
}
assertTrue(count!=0);
! list = s.find("select avg(foo.float), max(foo.component.name), count(distinct foo.id) from foo in class Foo");
//s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work!
|
|
From: <one...@us...> - 2002-11-24 12:53:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map
In directory sc8-pr-cvs1:/tmp/cvs-serv27087/cirrus/hibernate/map
Modified Files:
Table.java
Log Message:
got tests working on MySQL again
SchemaExport generates columns in the mapping-file order
Index: Table.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Table.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** Table.java 24 Nov 2002 11:48:11 -0000 1.28
--- Table.java 24 Nov 2002 12:53:21 -0000 1.29
***************
*** 3,8 ****
import java.util.Iterator;
! import java.util.SortedMap;
! import java.util.TreeMap;
import cirrus.hibernate.engine.Mapping;
--- 3,7 ----
import java.util.Iterator;
! import java.util.Map;
import cirrus.hibernate.engine.Mapping;
***************
*** 14,22 ****
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.tools.JdbcColumnInfo;
public class Table implements RelationalModel {
private String name;
private String schema;
! private SortedMap columns = new TreeMap();
private IdentifierGenerator identifierGenerator = Assigned.INSTANCE;
private PrimaryKey primaryKey;
--- 13,22 ----
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.tools.JdbcColumnInfo;
+ import org.apache.commons.collections.SequencedHashMap;
public class Table implements RelationalModel {
private String name;
private String schema;
! private Map columns = new SequencedHashMap();
private IdentifierGenerator identifierGenerator = Assigned.INSTANCE;
private PrimaryKey primaryKey;
|
|
From: <one...@us...> - 2002-11-24 11:48:14
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map
In directory sc8-pr-cvs1:/tmp/cvs-serv21277/cirrus/hibernate/map
Modified Files:
Collection.java IndexedCollection.java Set.java Table.java
Log Message:
fixed a bug where id column was sometimes nullable
Index: Collection.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Collection.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** Collection.java 8 Nov 2002 23:49:47 -0000 1.47
--- Collection.java 24 Nov 2002 11:48:11 -0000 1.48
***************
*** 24,28 ****
// All can be made final except table
! private Value identifier;
private Value element;
private Table table;
--- 24,28 ----
// All can be made final except table
! private Value key;
private Value element;
private Table table;
***************
*** 48,53 ****
}
! public Value getIdentifier() {
! return identifier;
}
public Value getElement() {
--- 48,53 ----
}
! public Value getKey() {
! return key;
}
public Value getElement() {
***************
*** 90,94 ****
for ( int i=0; i<list.getLength(); i++ ) {
String name = list.item(i).getNodeName();
! if ( "one-to-many".equals(name) || "association".equals(name) ) { //association is deprecated
isOneToMany = true;
oneToMany = new OneToMany( list.item(i), owner );
--- 90,94 ----
for ( int i=0; i<list.getLength(); i++ ) {
String name = list.item(i).getNodeName();
! if ( "one-to-many".equals(name) ) {
isOneToMany = true;
oneToMany = new OneToMany( list.item(i), owner );
***************
*** 141,147 ****
if ( "key".equals(name) || "generated-key".equals(name) ) {
! identifier = new Value(subnode, null, DEFAULT_KEY_COLUMN_NAME, isOneToMany, table, root);
! if (!toplevel) identifier.setType( owner.getIdentifier().getType() );
! if ( identifier.getType().returnedClass().isArray() ) throw new MappingException(
"illegal use of an array as an identifier (arrays don't reimplement equals)"
);
--- 141,147 ----
if ( "key".equals(name) || "generated-key".equals(name) ) {
! key = new Value(subnode, null, DEFAULT_KEY_COLUMN_NAME, isOneToMany, table, root);
! if (!toplevel) key.setType( owner.getIdentifier().getType() );
! if ( key.getType().returnedClass().isArray() ) throw new MappingException(
"illegal use of an array as an identifier (arrays don't reimplement equals)"
);
***************
*** 168,172 ****
// no foreign key for a one-to-many
! if (!toplevel) identifier.createForeignKeyOfClass( root, table, owner.getPersistentClass() );
// no foreign key for a toplevel
--- 168,172 ----
// no foreign key for a one-to-many
! if (!toplevel) key.createForeignKeyOfClass( root, table, owner.getPersistentClass() );
// no foreign key for a toplevel
***************
*** 214,218 ****
index.setName( StringHelper.suffix( table.getQualifiedName(), "IDX" + table.generateConstraintID() ) );
index.setTable(table);
! Iterator iter = getIdentifier().getColumnIterator();
while ( iter.hasNext() ) {
index.addColumn( (Column) iter.next() );
--- 214,218 ----
index.setName( StringHelper.suffix( table.getQualifiedName(), "IDX" + table.generateConstraintID() ) );
index.setTable(table);
! Iterator iter = getKey().getColumnIterator();
while ( iter.hasNext() ) {
index.addColumn( (Column) iter.next() );
Index: IndexedCollection.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/IndexedCollection.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** IndexedCollection.java 5 Oct 2002 07:52:10 -0000 1.8
--- IndexedCollection.java 24 Nov 2002 11:48:11 -0000 1.9
***************
*** 28,32 ****
public void createPrimaryKey() {
PrimaryKey pk = new PrimaryKey();
! Iterator iter = getIdentifier().getColumnIterator();
while ( iter.hasNext() ) {
pk.addColumn( (Column) iter.next() );
--- 28,32 ----
public void createPrimaryKey() {
PrimaryKey pk = new PrimaryKey();
! Iterator iter = getKey().getColumnIterator();
while ( iter.hasNext() ) {
pk.addColumn( (Column) iter.next() );
Index: Set.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Set.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Set.java 10 Oct 2002 05:52:13 -0000 1.13
--- Set.java 24 Nov 2002 11:48:11 -0000 1.14
***************
*** 53,57 ****
public void createPrimaryKey() {
PrimaryKey pk = new PrimaryKey();
! Iterator iter = getIdentifier().getColumnIterator();
while ( iter.hasNext() ) {
pk.addColumn( (Column) iter.next() );
--- 53,57 ----
public void createPrimaryKey() {
PrimaryKey pk = new PrimaryKey();
! Iterator iter = getKey().getColumnIterator();
while ( iter.hasNext() ) {
pk.addColumn( (Column) iter.next() );
Index: Table.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Table.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** Table.java 4 Nov 2002 00:55:30 -0000 1.27
--- Table.java 24 Nov 2002 11:48:11 -0000 1.28
***************
*** 46,50 ****
}
public void addColumn(Column column) {
! this.columns.put( column.getName(), column );
}
public int getColumnSpan() {
--- 46,52 ----
}
public void addColumn(Column column) {
! if ( columns.get( column.getName() )==null ) {
! columns.put( column.getName(), column );
! }
}
public int getColumnSpan() {
|
|
From: <one...@us...> - 2002-11-24 11:48:13
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv21277/cirrus/hibernate/impl
Modified Files:
CollectionPersister.java DatastoreImpl.java
Log Message:
fixed a bug where id column was sometimes nullable
Index: CollectionPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/CollectionPersister.java,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** CollectionPersister.java 31 Oct 2002 14:00:26 -0000 1.83
--- CollectionPersister.java 24 Nov 2002 11:48:10 -0000 1.84
***************
*** 93,99 ****
isToplevel = collection.isToplevel();
! keyType = collection.getIdentifier().getType();
! Iterator iter = collection.getIdentifier().getColumnIterator();
! int span = collection.getIdentifier().getColumnSpan();
keyColumnNames = new String[span];
int k=0;
--- 93,99 ----
isToplevel = collection.isToplevel();
! keyType = collection.getKey().getType();
! Iterator iter = collection.getKey().getColumnIterator();
! int span = collection.getKey().getColumnSpan();
keyColumnNames = new String[span];
int k=0;
***************
*** 105,109 ****
if (isToplevel) {
! idgen = collection.getIdentifier().getIdentifierGenerator();
}
else {
--- 105,109 ----
if (isToplevel) {
! idgen = collection.getKey().getIdentifierGenerator();
}
else {
Index: DatastoreImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/DatastoreImpl.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** DatastoreImpl.java 11 Nov 2002 10:09:55 -0000 1.21
--- DatastoreImpl.java 24 Nov 2002 11:48:11 -0000 1.22
***************
*** 48,52 ****
}
public Type getCollectionKeyType(String role) throws MappingException {
! return ( (Collection) collections.get(role) ).getIdentifier().getType();
}
--- 48,52 ----
}
public Type getCollectionKeyType(String role) throws MappingException {
! return ( (Collection) collections.get(role) ).getKey().getType();
}
|
|
From: <one...@us...> - 2002-11-24 11:00:42
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/id In directory sc8-pr-cvs1:/tmp/cvs-serv26775/cirrus/hibernate/id Modified Files: Assigned.java Log Message: fixed obsolete JavaDoc Index: Assigned.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/id/Assigned.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Assigned.java 26 Oct 2002 16:43:27 -0000 1.10 --- Assigned.java 24 Nov 2002 11:00:36 -0000 1.11 *************** *** 11,20 **** * <b>assigned</b><br> * <br> ! * An <tt>IdentifierGenerator</tt> that throws an exception if it is called. Used ! * as a placeholder to indicate that IDs for a class are manually ! * assigned using <tt>Session.insert()</tt>. ! * ! * @see cirrus.hibernate.Session#insert(java.lang.Object) ! * @see cirrus.hibernate.Session#insert(java.lang.Object, java.io.Serializable) */ --- 11,15 ---- * <b>assigned</b><br> * <br> ! * An <tt>IdentifierGenerator</tt> that returns the current identifier assigned to an instance. */ |
|
From: <one...@us...> - 2002-11-24 10:55:29
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19596/doc/reference/src
Modified Files:
manipulating_data.xml query_language.xml
Log Message:
documented fact that find() may now fetch scalar values
Index: manipulating_data.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/manipulating_data.xml,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** manipulating_data.xml 20 Nov 2002 10:27:48 -0000 1.27
--- manipulating_data.xml 24 Nov 2002 10:55:26 -0000 1.28
***************
*** 199,209 ****
<para>
! Queries called using <literal>iterate()</literal> may specify a property of a class
! in the <literal>select</literal> clause. They may even call SQL aggregate functions.
! Properties or aggregates are considered "scalar" results.
! </para>
! <para>
! In the current version, <literal>Session.find()</literal> may not be used to return
! scalar results (it <emphasis>always</emphasis> returns entities).
</para>
--- 199,205 ----
<para>
! Queries may specify a property of a class in the <literal>select</literal> clause.
! They may even call SQL aggregate functions. Properties or aggregates are considered
! "scalar" results.
</para>
***************
*** 221,225 ****
<programlisting><![CDATA[Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat");]]></programlisting>
</sect2>
--- 217,226 ----
<programlisting><![CDATA[Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat"
! );]]></programlisting>
!
! <programlisting><![CDATA[List list = sess.find(
! "select cat, cat.mate.name from cat in class eg.DomesticCat"
! );]]></programlisting>
</sect2>
***************
*** 355,362 ****
pk.getKittens(), "select this.mate where this.color = eg.Color.BLACK"
)]]></programlisting>
-
- <para>
- However, filters are <literal>find()</literal>-style queries; you can't select scalar values.
- </para>
</sect2>
--- 356,359 ----
Index: query_language.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/query_language.xml,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** query_language.xml 19 Nov 2002 15:35:35 -0000 1.21
--- query_language.xml 24 Nov 2002 10:55:26 -0000 1.22
***************
*** 56,60 ****
<para>
! For <literal>iterate()</literal> queries you may select any property (not just associations).
</para>
--- 56,60 ----
<para>
! You may select any property (not just associations):
</para>
***************
*** 72,78 ****
<para>
! Queries called called using <literal>iterate()</literal> may return properties of value type
! and may even return aggregate functions of these properties. Collections may also appear inside
! aggregate functions in the <literal>select</literal> clause.
</para>
--- 72,77 ----
<para>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <literal>select</literal> clause.
</para>
|
|
From: <one...@us...> - 2002-11-24 10:55:29
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html_single
In directory sc8-pr-cvs1:/tmp/cvs-serv19596/doc/reference/html_single
Modified Files:
index.html
Log Message:
documented fact that find() may now fetch scalar values
Index: index.html
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html_single/index.html,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** index.html 21 Nov 2002 09:03:27 -0000 1.82
--- index.html 24 Nov 2002 10:55:26 -0000 1.83
***************
*** 2111,2120 ****
....
}</pre><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s4"></a>6.3.1. Scalar queries</h3></div></div><p>
! Queries called using <tt>iterate()</tt> may specify a property of a class
! in the <tt>select</tt> clause. They may even call SQL aggregate functions.
! Properties or aggregates are considered "scalar" results.
! </p><p>
! In the current version, <tt>Session.find()</tt> may not be used to return
! scalar results (it <span class="emphasis"><em>always</em></span> returns entities).
</p><pre class="programlisting">Iterator results = sess.iterate(
"select cat.color, min(cat.birthdate), count(cat) from cat in class eg.Cat" +
--- 2111,2117 ----
....
}</pre><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s4"></a>6.3.1. Scalar queries</h3></div></div><p>
! Queries may specify a property of a class in the <tt>select</tt> clause.
! They may even call SQL aggregate functions. Properties or aggregates are considered
! "scalar" results.
</p><pre class="programlisting">Iterator results = sess.iterate(
"select cat.color, min(cat.birthdate), count(cat) from cat in class eg.Cat" +
***************
*** 2128,2132 ****
.....
}</pre><pre class="programlisting">Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat");</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s5"></a>6.3.2. The Query interface</h3></div></div><p>
If you need to specify bounds upon your result set (the maximum number of rows
you want to retrieve and / or the first row you want to retrieve) you should
--- 2125,2132 ----
.....
}</pre><pre class="programlisting">Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat"
! );</pre><pre class="programlisting">List list = sess.find(
! "select cat, cat.mate.name from cat in class eg.DomesticCat"
! );</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s5"></a>6.3.2. The Query interface</h3></div></div><p>
If you need to specify bounds upon your result set (the maximum number of rows
you want to retrieve and / or the first row you want to retrieve) you should
***************
*** 2203,2209 ****
</p><pre class="programlisting">Collection blackKittenMates = session.filter(
pk.getKittens(), "select this.mate where this.color = eg.Color.BLACK"
! )</pre><p>
! However, filters are <tt>find()</tt>-style queries; you can't select scalar values.
! </p></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s7"></a>6.4. Updating objects saved or loaded in the current session</h2></div></div><p>
<span class="emphasis"><em>Persistent instances</em></span> (ie. objects loaded, saved, created or
queried by the <tt>Session</tt>) may be manipulated by the application
--- 2203,2207 ----
</p><pre class="programlisting">Collection blackKittenMates = session.filter(
pk.getKittens(), "select this.mate where this.color = eg.Color.BLACK"
! )</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s7"></a>6.4. Updating objects saved or loaded in the current session</h2></div></div><p>
<span class="emphasis"><em>Persistent instances</em></span> (ie. objects loaded, saved, created or
queried by the <tt>Session</tt>) may be manipulated by the application
***************
*** 2569,2573 ****
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! For <tt>iterate()</tt> queries you may select any property (not just associations).
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
--- 2567,2571 ----
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! You may select any property (not just associations):
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
***************
*** 2577,2583 ****
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries called called using <tt>iterate()</tt> may return properties of value type
! and may even return aggregate functions of these properties. Collections may also appear inside
! aggregate functions in the <tt>select</tt> clause.
</p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
--- 2575,2580 ----
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <tt>select</tt> clause.
</p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
|
|
From: <one...@us...> - 2002-11-24 10:55:29
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html
In directory sc8-pr-cvs1:/tmp/cvs-serv19596/doc/reference/html
Modified Files:
manipulating-data.html query-language.html
Log Message:
documented fact that find() may now fetch scalar values
Index: manipulating-data.html
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/manipulating-data.html,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** manipulating-data.html 21 Nov 2002 09:03:22 -0000 1.23
--- manipulating-data.html 24 Nov 2002 10:55:26 -0000 1.24
***************
*** 140,149 ****
....
}</pre><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s4"></a>6.3.1. Scalar queries</h3></div></div><p>
! Queries called using <tt>iterate()</tt> may specify a property of a class
! in the <tt>select</tt> clause. They may even call SQL aggregate functions.
! Properties or aggregates are considered "scalar" results.
! </p><p>
! In the current version, <tt>Session.find()</tt> may not be used to return
! scalar results (it <span class="emphasis"><em>always</em></span> returns entities).
</p><pre class="programlisting">Iterator results = sess.iterate(
"select cat.color, min(cat.birthdate), count(cat) from cat in class eg.Cat" +
--- 140,146 ----
....
}</pre><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s4"></a>6.3.1. Scalar queries</h3></div></div><p>
! Queries may specify a property of a class in the <tt>select</tt> clause.
! They may even call SQL aggregate functions. Properties or aggregates are considered
! "scalar" results.
</p><pre class="programlisting">Iterator results = sess.iterate(
"select cat.color, min(cat.birthdate), count(cat) from cat in class eg.Cat" +
***************
*** 157,161 ****
.....
}</pre><pre class="programlisting">Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat");</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s5"></a>6.3.2. The Query interface</h3></div></div><p>
If you need to specify bounds upon your result set (the maximum number of rows
you want to retrieve and / or the first row you want to retrieve) you should
--- 154,161 ----
.....
}</pre><pre class="programlisting">Iterator iter = sess.iterate(
! "select cat.type, cat.birthdate, cat.name from cat in class eg.DomesticCat"
! );</pre><pre class="programlisting">List list = sess.find(
! "select cat, cat.mate.name from cat in class eg.DomesticCat"
! );</pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="manipulating-data-s5"></a>6.3.2. The Query interface</h3></div></div><p>
If you need to specify bounds upon your result set (the maximum number of rows
you want to retrieve and / or the first row you want to retrieve) you should
***************
*** 232,238 ****
</p><pre class="programlisting">Collection blackKittenMates = session.filter(
pk.getKittens(), "select this.mate where this.color = eg.Color.BLACK"
! )</pre><p>
! However, filters are <tt>find()</tt>-style queries; you can't select scalar values.
! </p></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s7"></a>6.4. Updating objects saved or loaded in the current session</h2></div></div><p>
<span class="emphasis"><em>Persistent instances</em></span> (ie. objects loaded, saved, created or
queried by the <tt>Session</tt>) may be manipulated by the application
--- 232,236 ----
</p><pre class="programlisting">Collection blackKittenMates = session.filter(
pk.getKittens(), "select this.mate where this.color = eg.Color.BLACK"
! )</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="manipulating-data-s7"></a>6.4. Updating objects saved or loaded in the current session</h2></div></div><p>
<span class="emphasis"><em>Persistent instances</em></span> (ie. objects loaded, saved, created or
queried by the <tt>Session</tt>) may be manipulated by the application
Index: query-language.html
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/query-language.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** query-language.html 19 Nov 2002 15:35:35 -0000 1.21
--- query-language.html 24 Nov 2002 10:55:26 -0000 1.22
***************
*** 22,26 ****
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! For <tt>iterate()</tt> queries you may select any property (not just associations).
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
--- 22,26 ----
Actually, you may express this query more compactly as:
</p><pre class="programlisting">select cat.mate from cat in class eg.Cat</pre><p>You may even select collection elements:</p><pre class="programlisting">select cat.kittens.elements from cat in class eg.Cat</pre><p>
! You may select any property (not just associations):
</p><pre class="programlisting">select cat.name from cat in class eg.DomesticCat
where cat.name like 'fri%'</pre><p>
***************
*** 30,36 ****
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries called called using <tt>iterate()</tt> may return properties of value type
! and may even return aggregate functions of these properties. Collections may also appear inside
! aggregate functions in the <tt>select</tt> clause.
</p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
--- 30,35 ----
from mother in class eg.DomesticCat, offspr in class eg.Cat
where offspr in mother.kittens.elements </pre><p>
! Queries may return properties of value type and may even return aggregate functions of these properties.
! Collections may also appear inside aggregate functions in the <tt>select</tt> clause.
</p><pre class="programlisting">select cat.name, cat.mate.name from cat in class eg.Cat
|
|
From: <one...@us...> - 2002-11-24 06:30:15
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query
In directory sc8-pr-cvs1:/tmp/cvs-serv11168/cirrus/hibernate/query
Modified Files:
QueryTranslator.java
Log Message:
QueryTranslator code cleanup
Index: QueryTranslator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** QueryTranslator.java 23 Nov 2002 01:16:21 -0000 1.47
--- QueryTranslator.java 24 Nov 2002 06:30:12 -0000 1.48
***************
*** 89,92 ****
--- 89,93 ----
private Queryable[] persisters;
private Type[] types;
+ private String[][] scalarColumnNames;
protected SessionFactoryImplementor factory;
private Map replacements;
***************
*** 95,99 ****
private String queryString;
private boolean distinct=false;
! private String sql;
private String selectPropertiesString;
private String selectIDString;
--- 96,100 ----
private String queryString;
private boolean distinct=false;
! private String fromWhereString;
private String selectPropertiesString;
private String selectIDString;
***************
*** 149,153 ****
try {
ParserHelper.parse( new PreprocessingParser(replacements), queryString, ParserHelper.HQL_SEPERATORS, this );
! sql = renderSQL();
}
catch (QueryException qe) {
--- 150,154 ----
try {
ParserHelper.parse( new PreprocessingParser(replacements), queryString, ParserHelper.HQL_SEPERATORS, this );
! renderSQL();
}
catch (QueryException qe) {
***************
*** 189,192 ****
--- 190,197 ----
}
+ public String[][] getScalarColumnNames() {
+ return scalarColumnNames;
+ }
+
private void logQuery(String hql, String sql) {
if ( log.isDebugEnabled() ) {
***************
*** 203,207 ****
String result = new StringBuffer(50)
.append(selectPropertiesString)
! .append(sql)
.toString();
logQuery(queryString, result);
--- 208,212 ----
String result = new StringBuffer(50)
.append(selectPropertiesString)
! .append(fromWhereString)
.toString();
logQuery(queryString, result);
***************
*** 215,219 ****
String result = new StringBuffer(50)
.append(selectIDString)
! .append(sql)
.toString();
logQuery(queryString, result);
--- 220,224 ----
String result = new StringBuffer(50)
.append(selectIDString)
! .append(fromWhereString)
.toString();
logQuery(queryString, result);
***************
*** 227,231 ****
String result= new StringBuffer(50)
.append(scalarSelectString)
! .append(sql)
.toString();
logQuery(queryString, result);
--- 232,236 ----
String result= new StringBuffer(50)
.append(scalarSelectString)
! .append(fromWhereString)
.toString();
logQuery(queryString, result);
***************
*** 416,431 ****
}
! private String renderSQL() throws QueryException, MappingException {
!
! String selectPerhapsDistinct = "SELECT ";
! if (distinct) selectPerhapsDistinct += "DISTINCT ";
!
! boolean isSubselect = superQuery!=null;
! if ( returnTypes.size()==0 && scalarTypes.size()==0) {
returnTypes = fromTypes;
}
-
int size = returnTypes.size();
persisters = new Queryable[size];
suffixes = new String[size];
--- 421,432 ----
}
! private void renderSQL() throws QueryException, MappingException {
! if ( returnTypes.size()==0 && scalarTypes.size()==0 ) {
! //ie no select clause in HQL
returnTypes = fromTypes;
}
int size = returnTypes.size();
+
persisters = new Queryable[size];
suffixes = new String[size];
***************
*** 437,444 ****
}
StringBuffer buf = new StringBuffer(20);
if ( scalarTypes.size()==0 ) {
!
for ( int k=0; k<size; k++ ) {
--- 438,531 ----
}
+ String selectPerhapsDistinct = "SELECT ";
+ if (distinct) selectPerhapsDistinct += "DISTINCT ";
+ String selectScalars = renderScalarSelect();
+ scalarSelectString = selectPerhapsDistinct + selectScalars;
+ String selectIdentifiers = renderIdentifierSelect();
+ selectIDString = selectPerhapsDistinct + selectIdentifiers + renderOrderByPropertiesSelect();
+ selectPropertiesString = selectPerhapsDistinct + selectIdentifiers + renderPropertiesSelect();
+ //TODO: for some dialiects it would be appropriate to add the renderOrderByPropertiesSelect() to other select strings
+ fromWhereString = renderFromClause() + renderWhereClause();
+
+ if ( scalarTypes.size()!=size ) {
+ if (size!=0) selectPropertiesString += ", ";
+ selectPropertiesString += selectScalars;
+ }
+
+ int scalarSize = scalarTypes.size();
+ types = new Type[scalarSize];
+ for ( int i=0; i<scalarSize; i++ ) {
+ types[i] = (Type) scalarTypes.get(i);
+ }
+
+ scalarColumnNames = generateColumnNames(types, factory);
+
+ // initialize the Set of queried identifier spaces (ie. tables)
+ Iterator iter = collections.values().iterator();
+ while ( iter.hasNext() ) {
+ CollectionPersister p = getCollectionPersister( (String) iter.next() );
+ addIdentifierSpace( p.getQualifiedTableName() );
+ }
+ iter = typeMap.keySet().iterator();
+ while ( iter.hasNext() ) {
+ Queryable p = getPersisterForName( (String) iter.next() );
+ addIdentifierSpace( p.getIdentifierSpace() );
+ }
+
+ }
+
+ private String renderIdentifierSelect() {
+ StringBuffer buf = new StringBuffer(40);
+ int size = returnTypes.size();
+
+ for ( int k=0; k<size; k++ ) {
+ String name = (String) returnTypes.get(k);
+ String suffix = size==1 ? "" : Integer.toString(k);
+ buf.append( persisters[k].selectIdentifierString(name, suffix) );
+ if ( k!=size-1 ) buf.append(", ");
+ }
+
+ return buf.toString();
+ }
+
+ private String renderOrderByPropertiesSelect() {
+ StringBuffer buf = new StringBuffer(10);
+
+ //add the columns we are ordering by to the select ID select clause
+ Iterator iter = orderByTokens.iterator();
+ while ( iter.hasNext() ) {
+ String token = (String) iter.next();
+ if ( token.lastIndexOf(".") > 0 ) {
+ //ie. it is of form "foo.bar", not of form "asc" or "desc"
+ buf.append(", ").append(token);
+ }
+ }
+
+ return buf.toString();
+ }
+
+ private String renderPropertiesSelect() {
+ StringBuffer buf = new StringBuffer(40);
+ int size = returnTypes.size();
+ for ( int k=0; k<size; k++ ) {
+ String suffix = (size==1) ? "" : Integer.toString(k);
+ String name = (String) returnTypes.get(k) ;
+ buf.append( persisters[k].propertySelectClauseFragment(name, suffix) );
+ }
+ return buf.toString();
+ }
+
+ /**
+ * WARNING: side-effecty
+ */
+ private String renderScalarSelect() {
+
+ boolean isSubselect = superQuery!=null;
+
StringBuffer buf = new StringBuffer(20);
if ( scalarTypes.size()==0 ) {
! //ie. no select clause
! int size = returnTypes.size();
for ( int k=0; k<size; k++ ) {
***************
*** 458,462 ****
}
else {
!
Iterator iter = scalarSelectTokens.iterator();
int c=0;
--- 545,549 ----
}
else {
! //there _was_ a select clause
Iterator iter = scalarSelectTokens.iterator();
int c=0;
***************
*** 495,557 ****
}
! String scalarSelectString = buf.toString();
! this.scalarSelectString = selectPerhapsDistinct + scalarSelectString; //TODO: clean up
!
! int ttsize = scalarTypes.size();
! types = new Type[ttsize];
! for ( int i=0; i<ttsize; i++ ) {
! types[i] = (Type) scalarTypes.get(i);
! }
!
! // The selectIDString or selectPropertiesString is used
! // depending upon how the query is to return its results
!
! buf = new StringBuffer(40);
!
! for ( int k=0; k<size; k++ ) {
! String name = (String) returnTypes.get(k);
! String suffix = size==1 ? "" : Integer.toString(k);
! buf.append( persisters[k].selectIdentifierString(name, suffix) );
! if ( k!=size-1 ) buf.append(", ");
! }
!
! selectIDString = selectPerhapsDistinct + buf.toString();
!
! for ( int k=0; k<size; k++ ) {
! String suffix = (size==1) ? "" : Integer.toString(k);
! String name = (String) returnTypes.get(k) ;
! buf.append( persisters[k].propertySelectClauseFragment(name, suffix) );
! }
!
! selectPropertiesString = selectPerhapsDistinct + buf.toString();
! if (ttsize!=size) {
! if (size!=0) selectPropertiesString += ", ";
! selectPropertiesString += scalarSelectString;
! }
!
//FROM
! buf = new StringBuffer(120)
.append(" FROM");
Iterator iter = typeMap.keySet().iterator();
- StringBuffer inClassWheres = new StringBuffer(50);
- boolean first = true;
while ( iter.hasNext() ) {
!
String name = (String) iter.next();
Queryable p = getPersisterForName(name);
- addIdentifierSpace( p.getIdentifierSpace() );
-
- //render the " foo_table foo," bit
buf.append(' ')
.append( p.fromClauseFragment(name) );
if ( iter.hasNext() || collections.size()!=0 ) buf.append(',');
-
- //render the " and foo.class in ( 'Foo', 'Bar' ) " bit
- String where = p.getQueryWhereClause(name);
- if ( where!=null ) {
- if (!first) inClassWheres.append(" and "); first=false;
- inClassWheres.append(where);
- }
-
}
--- 582,600 ----
}
! return buf.toString();
! }
!
! private String renderFromClause() throws QueryException, MappingException {
//FROM
! StringBuffer buf = new StringBuffer(120)
.append(" FROM");
Iterator iter = typeMap.keySet().iterator();
while ( iter.hasNext() ) {
! //render the " foo_table foo," bit
String name = (String) iter.next();
Queryable p = getPersisterForName(name);
buf.append(' ')
.append( p.fromClauseFragment(name) );
if ( iter.hasNext() || collections.size()!=0 ) buf.append(',');
}
***************
*** 564,571 ****
CollectionPersister p = getCollectionPersister(role);
buf.append( p.getQualifiedTableName() ).append(' ').append(name);
- addIdentifierSpace( p.getQualifiedTableName() );
if ( iter.hasNext() ) buf.append(',');
}
//WHERE
StringBuffer whereTokenBuf = new StringBuffer(40);
--- 607,638 ----
CollectionPersister p = getCollectionPersister(role);
buf.append( p.getQualifiedTableName() ).append(' ').append(name);
if ( iter.hasNext() ) buf.append(',');
}
+ return buf.toString();
+ }
+
+ private String renderWhereClause() throws QueryException, MappingException {
+
+ Iterator iter = typeMap.keySet().iterator();
+ StringBuffer inClassWheres = new StringBuffer(50);
+ boolean first = true;
+ while ( iter.hasNext() ) {
+
+ String name = (String) iter.next();
+ Queryable p = getPersisterForName(name);
+ addIdentifierSpace( p.getIdentifierSpace() );
+
+ //render the " and foo.class in ( 'Foo', 'Bar' ) " bit
+ String where = p.getQueryWhereClause(name);
+ if ( where!=null ) {
+ if (!first) inClassWheres.append(" and "); first=false;
+ inClassWheres.append(where);
+ }
+
+ }
+
+ StringBuffer buf = new StringBuffer(120);
+
//WHERE
StringBuffer whereTokenBuf = new StringBuffer(40);
***************
*** 605,619 ****
buf.append(" ORDER BY ");
appendTokens( buf, orderByTokens.iterator() );
-
- //add the columns we are ordering by to the select ID select clause
- StringBuffer buf2 = new StringBuffer(selectIDString);
- iter = orderByTokens.iterator();
- while ( iter.hasNext() ) {
- String token;
- if ( ( token = (String) iter.next() ).lastIndexOf(".") > 0 ) {
- buf2.append(", ").append(token);
- }
- }
- selectIDString = buf2.toString();
}
--- 672,675 ----
***************
*** 744,748 ****
ResultSet rs = st.executeQuery();
advance(rs, selection, session);
! return new IteratorImpl( rs, session, getReturnTypes() );
}
catch (SQLException sqle) {
--- 800,804 ----
ResultSet rs = st.executeQuery();
advance(rs, selection, session);
! return new IteratorImpl( rs, session, getReturnTypes(), getScalarColumnNames() );
}
catch (SQLException sqle) {
***************
*** 852,856 ****
}
! public static String[][] generateColumnNames(Type[] types, SessionFactoryImplementor f) throws MappingException {
String[][] names = new String[types.length][];
for (int i=0; i<types.length; i++) {
--- 908,912 ----
}
! private static String[][] generateColumnNames(Type[] types, SessionFactoryImplementor f) throws MappingException {
String[][] names = new String[types.length][];
for (int i=0; i<types.length; i++) {
|
|
From: <one...@us...> - 2002-11-24 06:30:15
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv11168/cirrus/hibernate/loader
Modified Files:
Loader.java
Log Message:
QueryTranslator code cleanup
Index: Loader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** Loader.java 23 Nov 2002 01:16:20 -0000 1.30
--- Loader.java 24 Nov 2002 06:30:12 -0000 1.31
***************
*** 25,29 ****
import cirrus.hibernate.impl.QueryImpl;
import cirrus.hibernate.persister.*;
- import cirrus.hibernate.query.QueryTranslator;
import cirrus.hibernate.type.Type;
--- 25,28 ----
***************
*** 72,76 ****
}
/**
! * The column types of a find() query
*/
protected Type[] getReturnTypes() {
--- 71,75 ----
}
/**
! * The return types of a find() query
*/
protected Type[] getReturnTypes() {
***************
*** 78,81 ****
--- 77,86 ----
}
/**
+ * The column names holding returned scalar values
+ */
+ public String[][] getScalarColumnNames() {
+ return null;
+ }
+ /**
* A hack to allow scalar values in a find() query
*/
***************
*** 128,132 ****
if (scalars) {
returnTypes = getReturnTypes();
! names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() );
}
--- 133,137 ----
if (scalars) {
returnTypes = getReturnTypes();
! names = getScalarColumnNames();
}
|
|
From: <one...@us...> - 2002-11-24 06:30:14
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv11168/cirrus/hibernate/impl
Modified Files:
IteratorImpl.java
Log Message:
QueryTranslator code cleanup
Index: IteratorImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/IteratorImpl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** IteratorImpl.java 23 Nov 2002 00:24:16 -0000 1.10
--- IteratorImpl.java 24 Nov 2002 06:30:11 -0000 1.11
***************
*** 13,17 ****
import cirrus.hibernate.LazyInitializationException;
import cirrus.hibernate.engine.SessionImplementor;
- import cirrus.hibernate.query.QueryTranslator;
import cirrus.hibernate.type.Type;
--- 13,16 ----
***************
*** 29,33 ****
private final String[][] names;
! public IteratorImpl(ResultSet rs, SessionImplementor sess, Type[] types)
throws HibernateException, SQLException {
--- 28,32 ----
private final String[][] names;
! public IteratorImpl(ResultSet rs, SessionImplementor sess, Type[] types, String[][] columnNames)
throws HibernateException, SQLException {
***************
*** 35,42 ****
this.sess = sess;
this.types = types;
! single = types.length==1;
!
! names = QueryTranslator.generateColumnNames( types, sess.getFactory() );
postNext( rs.next() );
--- 34,40 ----
this.sess = sess;
this.types = types;
+ this.names = columnNames;
! single = types.length==1;
postNext( rs.next() );
|
|
From: <one...@us...> - 2002-11-24 06:30:14
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv11168 Modified Files: changelog.txt Log Message: QueryTranslator code cleanup Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.270 retrieving revision 1.271 diff -C2 -d -r1.270 -r1.271 *** changelog.txt 21 Nov 2002 07:44:57 -0000 1.270 --- changelog.txt 24 Nov 2002 06:30:11 -0000 1.271 *************** *** 14,17 **** --- 14,22 ---- * now compiling properly under JDK1.2, 1.3 (fix by Tom Cellucci) * support for subcollections in query language: foo.bars[2]['index'], foo.bars[4].elements, foo.bars[0].size, etc. + * added calendar and calendar_date types + * find() queries may now return scalar values + * ConnectionProviders now set isolation level before toggle autocommit + * Iterator.next() now throws NoSuchElementException as per Iterator contract (fix by Alex Staubo) + * database reverse engineering GUI tool contributed by Tom Cellucci Changes in version 1.2 beta 2 (15.11.2002) |
|
From: <one...@us...> - 2002-11-24 06:30:14
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv11168/cirrus/hibernate Modified Files: Query.java Log Message: QueryTranslator code cleanup Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Query.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Query.java 21 Nov 2002 09:03:09 -0000 1.15 --- Query.java 24 Nov 2002 06:30:11 -0000 1.16 *************** *** 58,65 **** public Type[] getReturnTypes() throws HibernateException; /** ! * Return the query results as an <tt>Iterator</tt>. The query may ! * contain scalar values in its select clause. If the query contains ! * multiple results pre row, the results are returned in an instance ! * of <tt>Object[]</tt>.<br> * <br> * Entities returned as results are initialized on demand. The first --- 58,64 ---- public Type[] getReturnTypes() throws HibernateException; /** ! * Return the query results as an <tt>Iterator</tt>. If the query ! * contains multiple results pre row, the results are returned in ! * an instance of <tt>Object[]</tt>.<br> * <br> * Entities returned as results are initialized on demand. The first *************** *** 72,79 **** public Iterator iterate() throws SQLException, HibernateException; /** ! * Return the query results as <tt>ScrollableResults</tt>. The query ! * may contain scalar values in its select clause. The scrollability ! * of the returned results depends upon JDBC driver support for ! * scrollable <tt>ResultSet</tt>s.<br> * <br> * Entities returned as results are initialized on demand. The first --- 71,77 ---- public Iterator iterate() throws SQLException, HibernateException; /** ! * Return the query results as <tt>ScrollableResults</tt>. The ! * scrollability of the returned results depends upon JDBC driver ! * support for scrollable <tt>ResultSet</tt>s.<br> * <br> * Entities returned as results are initialized on demand. The first *************** *** 87,92 **** public ScrollableResults scroll() throws SQLException, HibernateException; /** ! * Return the query results as a <tt>List</tt>. The query may not ! * contain scalar values in its select clause. If the query contains * multiple results pre row, the results are returned in an instance * of <tt>Object[]</tt>. --- 85,89 ---- public ScrollableResults scroll() throws SQLException, HibernateException; /** ! * Return the query results as a <tt>List</tt>. If the query contains * multiple results pre row, the results are returned in an instance * of <tt>Object[]</tt>. |
|
From: <one...@us...> - 2002-11-23 01:16:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv7161/hibernate/test
Modified Files:
FooBarTest.java
Log Message:
more efficient impl of scalars-in-find() ... still hacky, though
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.226
retrieving revision 1.227
diff -C2 -d -r1.226 -r1.227
*** FooBarTest.java 22 Nov 2002 07:03:07 -0000 1.226
--- FooBarTest.java 23 Nov 2002 01:16:21 -0000 1.227
***************
*** 224,227 ****
--- 224,230 ----
s.save(baz);
baz.setDefaults();
+ Set bars = new HashSet();
+ bars.add( new Bar() );
+ baz.setCascadingBars(bars);
//System.out.println( s.print(baz) );
s.flush();
***************
*** 827,830 ****
--- 830,835 ----
assertTrue( ( (Integer) rs.next() ).intValue()==1, "id query count" );
assertTrue( !rs.hasNext() );
+
+ list = s.find( "from foo in class Foo where foo.boolean = ?", new Boolean(true), Hibernate.BOOLEAN );
list = s.find("select foo.long, foo.component.name, foo, foo.foo from foo in class Foo");
|