Hibernate SVN: r14064 - core/trunk/core/src/main/java/org/hibernate/criterion.
by hibernate-commits@lists.jboss.org
Author: d.plentz
Date: 2007-10-05 09:54:14 -0400 (Fri, 05 Oct 2007)
New Revision: 14064
Modified:
core/trunk/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java
Log:
[HHH-1696] Add outer join support for aliases on DetachedCriteria
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java 2007-10-05 13:53:39 UTC (rev 14063)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java 2007-10-05 13:54:14 UTC (rev 14064)
@@ -6,10 +6,10 @@
import org.hibernate.Criteria;
import org.hibernate.FetchMode;
import org.hibernate.HibernateException;
+import org.hibernate.LockMode;
import org.hibernate.Session;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.impl.CriteriaImpl;
-import org.hibernate.impl.SessionImpl;
import org.hibernate.transform.ResultTransformer;
/**
@@ -122,4 +122,32 @@
CriteriaImpl getCriteriaImpl() {
return impl;
}
+
+ public DetachedCriteria createAlias(String associationPath, String alias, int joinType) throws HibernateException {
+ criteria.createAlias(associationPath, alias, joinType);
+ return this;
+ }
+
+ public DetachedCriteria createCriteria(String associationPath, int joinType) throws HibernateException {
+ return new DetachedCriteria(impl, criteria.createCriteria(associationPath, joinType));
+ }
+
+ public DetachedCriteria createCriteria(String associationPath, String alias, int joinType) throws HibernateException {
+ return new DetachedCriteria(impl, criteria.createCriteria(associationPath, alias, joinType));
+ }
+
+ public DetachedCriteria setComment(String comment) {
+ criteria.setComment(comment);
+ return this;
+ }
+
+ public DetachedCriteria setLockMode(LockMode lockMode) {
+ criteria.setLockMode(lockMode);
+ return this;
+ }
+
+ public DetachedCriteria setLockMode(String alias, LockMode lockMode) {
+ criteria.setLockMode(alias, lockMode);
+ return this;
+ }
}
17 years, 2 months
Hibernate SVN: r14063 - core/branches/Branch_3_2/src/org/hibernate/criterion.
by hibernate-commits@lists.jboss.org
Author: d.plentz
Date: 2007-10-05 09:53:39 -0400 (Fri, 05 Oct 2007)
New Revision: 14063
Modified:
core/branches/Branch_3_2/src/org/hibernate/criterion/DetachedCriteria.java
Log:
[HHH-1696] Add outer join support for aliases on DetachedCriteria
Modified: core/branches/Branch_3_2/src/org/hibernate/criterion/DetachedCriteria.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/criterion/DetachedCriteria.java 2007-10-05 12:55:35 UTC (rev 14062)
+++ core/branches/Branch_3_2/src/org/hibernate/criterion/DetachedCriteria.java 2007-10-05 13:53:39 UTC (rev 14063)
@@ -6,10 +6,10 @@
import org.hibernate.Criteria;
import org.hibernate.FetchMode;
import org.hibernate.HibernateException;
+import org.hibernate.LockMode;
import org.hibernate.Session;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.impl.CriteriaImpl;
-import org.hibernate.impl.SessionImpl;
import org.hibernate.transform.ResultTransformer;
/**
@@ -122,4 +122,32 @@
CriteriaImpl getCriteriaImpl() {
return impl;
}
+
+ public DetachedCriteria createAlias(String associationPath, String alias, int joinType) throws HibernateException {
+ criteria.createAlias(associationPath, alias, joinType);
+ return this;
+ }
+
+ public DetachedCriteria createCriteria(String associationPath, int joinType) throws HibernateException {
+ return new DetachedCriteria(impl, criteria.createCriteria(associationPath, joinType));
+ }
+
+ public DetachedCriteria createCriteria(String associationPath, String alias, int joinType) throws HibernateException {
+ return new DetachedCriteria(impl, criteria.createCriteria(associationPath, alias, joinType));
+ }
+
+ public DetachedCriteria setComment(String comment) {
+ criteria.setComment(comment);
+ return this;
+ }
+
+ public DetachedCriteria setLockMode(LockMode lockMode) {
+ criteria.setLockMode(lockMode);
+ return this;
+ }
+
+ public DetachedCriteria setLockMode(String alias, LockMode lockMode) {
+ criteria.setLockMode(alias, lockMode);
+ return this;
+ }
}
17 years, 2 months
Hibernate SVN: r14062 - core/trunk/core/src/main/java/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: d.plentz
Date: 2007-10-05 08:55:35 -0400 (Fri, 05 Oct 2007)
New Revision: 14062
Modified:
core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
Log:
[HHH-2598] Mapping a collection of entities from two different classes with the same collection name results in duplicate backref property exception if collection keys are not null
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2007-10-05 12:49:52 UTC (rev 14061)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2007-10-05 12:55:35 UTC (rev 14062)
@@ -632,10 +632,7 @@
// PERSISTER
Attribute persisterNode = node.attribute( "persister" );
- if ( persisterNode == null ) {
- // persister = SingleTableEntityPersister.class;
- }
- else {
+ if ( persisterNode != null ) {
try {
entity.setEntityPersisterClass( ReflectHelper.classForName( persisterNode
.getValue() ) );
@@ -2249,7 +2246,7 @@
String entityName = ( (OneToMany) list.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
IndexBackref ib = new IndexBackref();
- ib.setName( '_' + node.attributeValue( "name" ) + "IndexBackref" );
+ ib.setName( '_' + list.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );
ib.setUpdateable( false );
ib.setSelectable( false );
ib.setCollectionRole( list.getRole() );
@@ -2352,7 +2349,7 @@
String entityName = ( (OneToMany) map.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
IndexBackref ib = new IndexBackref();
- ib.setName( '_' + node.attributeValue( "name" ) + "IndexBackref" );
+ ib.setName( '_' + map.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );
ib.setUpdateable( false );
ib.setSelectable( false );
ib.setCollectionRole( map.getRole() );
@@ -2485,7 +2482,7 @@
String entityName = ( (OneToMany) collection.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
Backref prop = new Backref();
- prop.setName( '_' + node.attributeValue( "name" ) + "Backref" );
+ prop.setName( '_' + collection.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "Backref" );
prop.setUpdateable( false );
prop.setSelectable( false );
prop.setCollectionRole( collection.getRole() );
17 years, 2 months
Hibernate SVN: r14061 - core/branches/Branch_3_2/src/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: d.plentz
Date: 2007-10-05 08:49:52 -0400 (Fri, 05 Oct 2007)
New Revision: 14061
Modified:
core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java
Log:
[HHH-2598] Mapping a collection of entities from two different classes with the same collection name results in duplicate backref property exception if collection keys are not null
Modified: core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java 2007-10-04 18:52:48 UTC (rev 14060)
+++ core/branches/Branch_3_2/src/org/hibernate/cfg/HbmBinder.java 2007-10-05 12:49:52 UTC (rev 14061)
@@ -633,10 +633,7 @@
// PERSISTER
Attribute persisterNode = node.attribute( "persister" );
- if ( persisterNode == null ) {
- // persister = SingleTableEntityPersister.class;
- }
- else {
+ if ( persisterNode != null ) {
try {
entity.setEntityPersisterClass( ReflectHelper.classForName( persisterNode
.getValue() ) );
@@ -2250,7 +2247,7 @@
String entityName = ( (OneToMany) list.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
IndexBackref ib = new IndexBackref();
- ib.setName( '_' + node.attributeValue( "name" ) + "IndexBackref" );
+ ib.setName( '_' + list.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );
ib.setUpdateable( false );
ib.setSelectable( false );
ib.setCollectionRole( list.getRole() );
@@ -2353,7 +2350,7 @@
String entityName = ( (OneToMany) map.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
IndexBackref ib = new IndexBackref();
- ib.setName( '_' + node.attributeValue( "name" ) + "IndexBackref" );
+ ib.setName( '_' + map.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );
ib.setUpdateable( false );
ib.setSelectable( false );
ib.setCollectionRole( map.getRole() );
@@ -2486,7 +2483,7 @@
String entityName = ( (OneToMany) collection.getElement() ).getReferencedEntityName();
PersistentClass referenced = mappings.getClass( entityName );
Backref prop = new Backref();
- prop.setName( '_' + node.attributeValue( "name" ) + "Backref" );
+ prop.setName( '_' + collection.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "Backref" );
prop.setUpdateable( false );
prop.setSelectable( false );
prop.setCollectionRole( collection.getRole() );
17 years, 2 months
Hibernate SVN: r14060 - tags.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-04 14:52:48 -0400 (Thu, 04 Oct 2007)
New Revision: 14060
Added:
tags/TOOLS_3_2_0_BETA11/
Log:
tag
17 years, 2 months
Hibernate SVN: r14059 - in branches/Branch_3_2/HibernateExt/tools: src/java/org/hibernate/tool and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-04 10:47:58 -0400 (Thu, 04 Oct 2007)
New Revision: 14059
Modified:
branches/Branch_3_2/HibernateExt/tools/build.xml
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/Version.java
Log:
bump version
Modified: branches/Branch_3_2/HibernateExt/tools/build.xml
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/build.xml 2007-10-03 06:26:59 UTC (rev 14058)
+++ branches/Branch_3_2/HibernateExt/tools/build.xml 2007-10-04 14:47:58 UTC (rev 14059)
@@ -7,7 +7,7 @@
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Tools"/>
<property name="name" value="hibernate-tools"/>
- <property name="version" value="3.2.0b10"/>
+ <property name="version" value="3.2.0b11"/>
<property name="javadoc.packagenames" value="org.hibernate.tool"/>
Modified: branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/Version.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/Version.java 2007-10-03 06:26:59 UTC (rev 14058)
+++ branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/Version.java 2007-10-04 14:47:58 UTC (rev 14059)
@@ -5,7 +5,7 @@
final public class Version {
- public static final String VERSION = "3.2.0.b10";
+ public static final String VERSION = "3.2.0.b11";
private static final Version instance = new Version();
17 years, 2 months
Hibernate SVN: r14058 - core/trunk/testsuite/src/test/java/org/hibernate/test/cfg.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 02:26:59 -0400 (Wed, 03 Oct 2007)
New Revision: 14058
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/cfg/CacheableFileTest.java
Log:
HHH-2813 : platform incompat
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/cfg/CacheableFileTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/cfg/CacheableFileTest.java 2007-10-03 06:17:01 UTC (rev 14057)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/cfg/CacheableFileTest.java 2007-10-03 06:26:59 UTC (rev 14058)
@@ -22,7 +22,7 @@
protected void setUp() throws Exception {
super.setUp();
- mappingFile = new File( getClass().getClassLoader().getResource( MAPPING ).getFile() );
+ mappingFile = new File( getClass().getClassLoader().getResource( MAPPING ).toURI() );
assertTrue( mappingFile.exists() );
File cached = new File( mappingFile.getParentFile(), mappingFile.getName() + ".bin" );
if ( cached.exists() ) {
17 years, 2 months
Hibernate SVN: r14057 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 02:17:01 -0400 (Wed, 03 Oct 2007)
New Revision: 14057
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java
Log:
HHH-2822 : added functions for SAPDBDialect
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java 2007-10-03 06:16:46 UTC (rev 14056)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java 2007-10-03 06:17:01 UTC (rev 14057)
@@ -7,12 +7,13 @@
import org.hibernate.Hibernate;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.NoArgSQLFunction;
+import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
+import org.hibernate.sql.JoinFragment;
import org.hibernate.sql.OracleJoinFragment;
-import org.hibernate.sql.JoinFragment;
import org.hibernate.util.StringHelper;
/**
@@ -74,6 +75,15 @@
registerFunction("date", new StandardSQLFunction("date", Hibernate.DATE) );
registerFunction("microsecond", new StandardSQLFunction("microsecond", Hibernate.INTEGER) );
+ registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "second(?1)") );
+ registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "minute(?1)") );
+ registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "hour(?1)") );
+ registerFunction( "day", new SQLFunctionTemplate(Hibernate.INTEGER, "day(?1)") );
+ registerFunction( "month", new SQLFunctionTemplate(Hibernate.INTEGER, "month(?1)") );
+ registerFunction( "year", new SQLFunctionTemplate(Hibernate.INTEGER, "year(?1)") );
+
+ registerFunction( "extract", new SQLFunctionTemplate(Hibernate.INTEGER, "?1(?3)") );
+
registerFunction("dayname", new StandardSQLFunction("dayname", Hibernate.STRING) );
registerFunction("monthname", new StandardSQLFunction("monthname", Hibernate.STRING) );
registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth", Hibernate.INTEGER) );
17 years, 2 months
Hibernate SVN: r14056 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 02:16:46 -0400 (Wed, 03 Oct 2007)
New Revision: 14056
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java
Log:
HHH-2822 : added functions for SAPDBDialect
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java 2007-10-03 05:44:41 UTC (rev 14055)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java 2007-10-03 06:16:46 UTC (rev 14056)
@@ -9,6 +9,7 @@
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
+import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
import org.hibernate.sql.OracleJoinFragment;
@@ -74,6 +75,15 @@
registerFunction("date", new StandardSQLFunction("date", Hibernate.DATE) );
registerFunction("microsecond", new StandardSQLFunction("microsecond", Hibernate.INTEGER) );
+ registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "second(?1)") );
+ registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "minute(?1)") );
+ registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "hour(?1)") );
+ registerFunction( "day", new SQLFunctionTemplate(Hibernate.INTEGER, "day(?1)") );
+ registerFunction( "month", new SQLFunctionTemplate(Hibernate.INTEGER, "month(?1)") );
+ registerFunction( "year", new SQLFunctionTemplate(Hibernate.INTEGER, "year(?1)") );
+
+ registerFunction( "extract", new SQLFunctionTemplate(Hibernate.INTEGER, "?1(?3)") );
+
registerFunction("dayname", new StandardSQLFunction("dayname", Hibernate.STRING) );
registerFunction("monthname", new StandardSQLFunction("monthname", Hibernate.STRING) );
registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth", Hibernate.INTEGER) );
17 years, 2 months
Hibernate SVN: r14055 - core/trunk/core/src/main/java/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 01:44:41 -0400 (Wed, 03 Oct 2007)
New Revision: 14055
Modified:
core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
Log:
HHH-2861 : validation of delete-orphan for to-one association cascading
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2007-10-03 05:44:20 UTC (rev 14054)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2007-10-03 05:44:41 UTC (rev 14055)
@@ -1566,9 +1566,9 @@
}
private static void validateCascade(Element node, String path) {
- String cascade = node.attributeValue("cascade");
- if ( cascade!=null && cascade.indexOf("delete-orphan")>0 ) {
- throw new MappingException("single-valued associations do not support orphan delete: " + path);
+ String cascade = node.attributeValue( "cascade" );
+ if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) {
+ throw new MappingException( "single-valued associations do not support orphan delete: " + path );
}
}
17 years, 2 months