Hibernate SVN: r18196 - core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-10 09:27:30 -0500 (Thu, 10 Dec 2009)
New Revision: 18196
Modified:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/CriteriaCompilingTest.java
Log:
HHH-4663 Add test showing the serialization failure for CriteriaQuery
Modified: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/CriteriaCompilingTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/CriteriaCompilingTest.java 2009-12-10 14:11:33 UTC (rev 18195)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/CriteriaCompilingTest.java 2009-12-10 14:27:30 UTC (rev 18196)
@@ -23,7 +23,13 @@
*/
package org.hibernate.ejb.criteria;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Join;
@@ -106,4 +112,44 @@
em.close();
}
+ //FIXME uncomment the serialization line and enjoy the test failing
+ public void testSerialization() {
+ EntityManager em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+
+ CriteriaQuery<Order> criteria = em.getCriteriaBuilder().createQuery( Order.class );
+ Root<Order> root = criteria.from( Order.class );
+ root.fetch( "lineItems" );
+ criteria.select( root );
+
+ //FIXME uncomment the serialization line and enjoy the test failing
+ //criteria = serializeDdeserialize( criteria );
+
+ em.createQuery( criteria ).getResultList();
+
+ em.getTransaction().commit();
+ em.close();
+ }
+
+ private <T> T serializeDdeserialize(T object) {
+ T serializedObject = null;
+ try {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ ObjectOutput out = new ObjectOutputStream( stream );
+ out.writeObject( object );
+ out.close();
+ byte[] serialized = stream.toByteArray();
+ stream.close();
+ ByteArrayInputStream byteIn = new ByteArrayInputStream( serialized );
+ ObjectInputStream in = new ObjectInputStream( byteIn );
+ serializedObject = (T) in.readObject();
+ in.close();
+ byteIn.close();
+ }
+ catch (Exception e) {
+ fail("Unable to serialize / deserialize the object: " + e.getMessage() );
+ }
+ return serializedObject;
+ }
+
}
15 years
Hibernate SVN: r18195 - core/trunk/entitymanager/src/main/java/org/hibernate/ejb.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-10 09:11:33 -0500 (Thu, 10 Dec 2009)
New Revision: 18195
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
Log:
HHH-4662 do not rollback when the exception occurs
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-10 14:01:39 UTC (rev 18194)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-10 14:11:33 UTC (rev 18195)
@@ -44,6 +44,7 @@
import javax.persistence.TypedQuery;
import javax.persistence.PessimisticLockScope;
import javax.persistence.LockTimeoutException;
+import javax.persistence.QueryTimeoutException;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.metamodel.Metamodel;
@@ -809,6 +810,9 @@
if ( e instanceof LockTimeoutException ) {
return;
}
+ if ( e instanceof QueryTimeoutException ) {
+ return;
+ }
try {
markAsRollback();
15 years
Hibernate SVN: r18194 - validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-10 09:01:39 -0500 (Thu, 10 Dec 2009)
New Revision: 18194
Modified:
validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_fr.properties
Log:
HV-275
Modified: validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_fr.properties
===================================================================
--- validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_fr.properties 2009-12-10 13:35:25 UTC (rev 18193)
+++ validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_fr.properties 2009-12-10 14:01:39 UTC (rev 18194)
@@ -14,5 +14,5 @@
javax.validation.constraints.Digits.message=Valeur num\u00E9rique hors limite (<{integer} chiffres>.<{fraction} chiffres> attendus)
javax.validation.constraints.DecimalMin.message=doit \u00EAtre plus grand que {value}
javax.validation.constraints.DecimalMax.message=doit \u00EAtre plus petit que {value}
-org.hibernate.validator.constraints.Email.message=Address email mal form\u00E9e
+org.hibernate.validator.constraints.Email.message=Addresse email mal form\u00E9e
org.hibernate.validator.constraints.Range.message=doit \u00EAtre entre {min} et {max}
\ No newline at end of file
15 years
Hibernate SVN: r18193 - validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-10 08:35:25 -0500 (Thu, 10 Dec 2009)
New Revision: 18193
Modified:
validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_de.properties
Log:
HV-278
Modified: validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_de.properties
===================================================================
--- validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_de.properties 2009-12-10 13:31:23 UTC (rev 18192)
+++ validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages_de.properties 2009-12-10 13:35:25 UTC (rev 18193)
@@ -11,7 +11,7 @@
javax.validation.constraints.Future.message=muss in der Zukunft liegen
javax.validation.constraints.AssertTrue.message=muss wahr sein
javax.validation.constraints.AssertFalse.message=muss falsch sein
-javax.validation.constraints.Digits.message=numerischer Wert au\u00DFerhalb erlaubten Wertebereichs (<{integer} Ziffern>.<{fraction} Ziffern> erwarted)
+javax.validation.constraints.Digits.message=numerischer Wert au\u00DFerhalb erlaubten Wertebereichs (<{integer} Ziffern>.<{fraction} Ziffern> erwartet)
javax.validation.constraints.DecimalMin.message=muss gr\u00F6ssergleich {value} sein
javax.validation.constraints.DecimalMax.message=muss kleinergleich {value} sein
org.hibernate.validator.constraints.Email.message=keine g\u00FCltige E-Mail-Adresse
15 years
Hibernate SVN: r18192 - in validator/trunk: hibernate-validator and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-10 08:31:23 -0500 (Thu, 10 Dec 2009)
New Revision: 18192
Modified:
validator/trunk/hibernate-validator-annotation-processor/pom.xml
validator/trunk/hibernate-validator-archetype/pom.xml
validator/trunk/hibernate-validator-legacy/pom.xml
validator/trunk/hibernate-validator-tck-runner/pom.xml
validator/trunk/hibernate-validator/pom.xml
validator/trunk/pom.xml
Log:
updated pom version number - we are working against 4.1.0
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/hibernate-validator/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -4,7 +4,7 @@
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: validator/trunk/hibernate-validator-annotation-processor/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/hibernate-validator-annotation-processor/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -6,7 +6,7 @@
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.hibernate</groupId>
Modified: validator/trunk/hibernate-validator-archetype/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-archetype/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/hibernate-validator-archetype/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -6,7 +6,7 @@
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.hibernate</groupId>
Modified: validator/trunk/hibernate-validator-legacy/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-legacy/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/hibernate-validator-legacy/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -6,7 +6,7 @@
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hibernate-validator-legacy</artifactId>
Modified: validator/trunk/hibernate-validator-tck-runner/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -1,12 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
<artifactId>hibernate-validator-tck-runner</artifactId>
<name>Hibernate Validator TCK Runner</name>
<description>Aggregates dependencies and run's the JSR-303 TCK</description>
Modified: validator/trunk/pom.xml
===================================================================
--- validator/trunk/pom.xml 2009-12-10 09:32:25 UTC (rev 18191)
+++ validator/trunk/pom.xml 2009-12-10 13:31:23 UTC (rev 18192)
@@ -5,7 +5,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<packaging>pom</packaging>
- <version>4.0.3-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>Hibernate Validator Parent</name>
<url>http://validator.hibernate.org</url>
15 years
Hibernate SVN: r18191 - in core/trunk: annotations/src/main/java/org/hibernate/cfg and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-10 04:32:25 -0500 (Thu, 10 Dec 2009)
New Revision: 18191
Added:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/DetachAndContainsTest.java
Modified:
core/trunk/annotations/src/main/java/org/hibernate/annotations/CascadeType.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/Mouth.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/CascadeTest.java
Log:
HHH-4657 add support for DETACH
Modified: core/trunk/annotations/src/main/java/org/hibernate/annotations/CascadeType.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/annotations/CascadeType.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/annotations/src/main/java/org/hibernate/annotations/CascadeType.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -37,5 +37,8 @@
REPLICATE,
DELETE_ORPHAN,
LOCK,
- EVICT
+ /** @deprecated use DETACH */
+ @Deprecated
+ EVICT,
+ DETACH
}
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -2518,6 +2518,9 @@
case REFRESH:
hibernateCascadeSet.add( CascadeType.REFRESH );
break;
+ case DETACH:
+ hibernateCascadeSet.add( CascadeType.DETACH );
+ break;
}
}
}
@@ -2565,6 +2568,7 @@
cascade.append( "," ).append( "replicate" );
break;
case EVICT:
+ case DETACH:
cascade.append( "," ).append( "evict" );
break;
case DELETE:
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -810,6 +810,7 @@
if ( subelement.element( "cascade-merge" ) != null ) cascades.add( CascadeType.MERGE );
if ( subelement.element( "cascade-remove" ) != null ) cascades.add( CascadeType.REMOVE );
if ( subelement.element( "cascade-refresh" ) != null ) cascades.add( CascadeType.REFRESH );
+ if ( subelement.element( "cascade-detach" ) != null ) cascades.add( CascadeType.DETACH );
}
if ( Boolean.TRUE.equals( defaults.getCascadePersist() )
&& !cascades.contains( CascadeType.ALL ) && !cascades.contains( CascadeType.PERSIST ) ) {
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -102,6 +102,40 @@
s.close();
}
+ public void testDetach() {
+ Session s;
+ Transaction tx;
+ s = openSession();
+ tx = s.beginTransaction();
+ Tooth tooth = new Tooth();
+ Mouth mouth = new Mouth();
+ s.persist( mouth );
+ s.persist( tooth );
+ tooth.mouth = mouth;
+ mouth.teeth = new ArrayList<Tooth>();
+ mouth.teeth.add( tooth );
+ tx.commit();
+ s.close();
+
+ s = openSession();
+ tx = s.beginTransaction();
+ mouth = (Mouth) s.get( Mouth.class, mouth.id );
+ assertNotNull( mouth );
+ assertEquals( 1, mouth.teeth.size() );
+ tooth = mouth.teeth.iterator().next();
+ s.evict( mouth );
+ assertFalse( s.contains( tooth ) );
+ tx.commit();
+ s.close();
+
+ s = openSession();
+ tx = s.beginTransaction();
+ s.delete( s.get( Mouth.class, mouth.id ) );
+
+ tx.commit();
+ s.close();
+ }
+
public CascadeTest(String x) {
super( x );
}
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/Mouth.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/Mouth.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cascade/Mouth.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -8,6 +8,7 @@
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Column;
+import static javax.persistence.CascadeType.*;
/**
* @author Emmanuel Bernard
@@ -19,6 +20,6 @@
public Integer id;
@Column(name="mouth_size")
public int size;
- @OneToMany(mappedBy = "mouth", cascade = CascadeType.REMOVE)
+ @OneToMany(mappedBy = "mouth", cascade = { REMOVE, DETACH } )
public Collection<Tooth> teeth;
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/AbstractEntityManagerImpl.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -43,6 +43,7 @@
import javax.persistence.TransactionRequiredException;
import javax.persistence.TypedQuery;
import javax.persistence.PessimisticLockScope;
+import javax.persistence.LockTimeoutException;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.metamodel.Metamodel;
@@ -805,6 +806,9 @@
if ( e instanceof NonUniqueResultException ) {
return;
}
+ if ( e instanceof LockTimeoutException ) {
+ return;
+ }
try {
markAsRollback();
Modified: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/CascadeTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/CascadeTest.java 2009-12-10 00:34:12 UTC (rev 18190)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/CascadeTest.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -31,8 +31,7 @@
em.persist( teacher );
em.getTransaction().commit();
-
- System.out.println("***************************");
+
em = getOrCreateEntityManager();
em.getTransaction().begin();
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/DetachAndContainsTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/DetachAndContainsTest.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/cascade/DetachAndContainsTest.java 2009-12-10 09:32:25 UTC (rev 18191)
@@ -0,0 +1,78 @@
+package org.hibernate.ejb.test.cascade;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.OneToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.EntityManager;
+import static javax.persistence.CascadeType.*;
+
+import org.hibernate.ejb.test.TestCase;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class DetachAndContainsTest extends TestCase {
+
+ public void testDetach() {
+ EntityManager em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+
+ Tooth tooth = new Tooth();
+ Mouth mouth = new Mouth();
+ em.persist( mouth );
+ em.persist( tooth );
+ tooth.mouth = mouth;
+ mouth.teeth = new ArrayList<Tooth>();
+ mouth.teeth.add( tooth );
+ em.getTransaction().commit();
+ em.close();
+
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ mouth = em.find( Mouth.class, mouth.id );
+ assertNotNull( mouth );
+ assertEquals( 1, mouth.teeth.size() );
+ tooth = mouth.teeth.iterator().next();
+ em.detach( mouth );
+ assertFalse( em.contains( tooth ) );
+ em.getTransaction().commit();
+ em.close();
+
+ em = getOrCreateEntityManager();
+ em.getTransaction().begin();
+ em.remove( em.find( Mouth.class, mouth.id ) );
+
+ em.getTransaction().commit();
+ em.close();
+ }
+
+ public Class[] getAnnotatedClasses() {
+ return new Class[] {
+ Mouth.class,
+ Tooth.class
+ };
+ }
+
+ @Entity
+ public static class Mouth {
+ @Id
+ @GeneratedValue
+ public Integer id;
+ @OneToMany(mappedBy = "mouth", cascade = { DETACH, REMOVE } )
+ public Collection<Tooth> teeth;
+ }
+
+ @Entity
+ public static class Tooth {
+ @Id
+ @GeneratedValue
+ public Integer id;
+ public String type;
+ @ManyToOne
+ public Mouth mouth;
+ }
+}
15 years
Hibernate SVN: r18190 - core/trunk/core/src/main/java/org/hibernate.
by hibernate-commits@lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2009-12-09 19:34:12 -0500 (Wed, 09 Dec 2009)
New Revision: 18190
Modified:
core/trunk/core/src/main/java/org/hibernate/OptimisticLockException.java
Log:
comment change
Modified: core/trunk/core/src/main/java/org/hibernate/OptimisticLockException.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/OptimisticLockException.java 2009-12-10 00:33:22 UTC (rev 18189)
+++ core/trunk/core/src/main/java/org/hibernate/OptimisticLockException.java 2009-12-10 00:34:12 UTC (rev 18190)
@@ -1,7 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
15 years
Hibernate SVN: r18189 - in core/trunk/core/src/main/java/org/hibernate: dialect and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2009-12-09 19:33:22 -0500 (Wed, 09 Dec 2009)
New Revision: 18189
Modified:
core/trunk/core/src/main/java/org/hibernate/PessimisticLockException.java
core/trunk/core/src/main/java/org/hibernate/dialect/DerbyDialect.java
core/trunk/core/src/main/java/org/hibernate/dialect/Dialect.java
core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadSelectLockingStrategy.java
core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadUpdateLockingStrategy.java
core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteSelectLockingStrategy.java
core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteUpdateLockingStrategy.java
Log:
HHH-4546 JPA-2.0 locking support. Derby read and write pessimistic lock
Modified: core/trunk/core/src/main/java/org/hibernate/PessimisticLockException.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/PessimisticLockException.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/PessimisticLockException.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -1,7 +1,7 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
@@ -38,6 +38,11 @@
super(s);
}
+ public PessimisticLockException(String s, Throwable throwable, Object entity) {
+ super(s, throwable);
+ this.entity = entity;
+ }
+
public PessimisticLockException(String s, Object entity) {
super(s);
this.entity = entity;
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DerbyDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DerbyDialect.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DerbyDialect.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -121,6 +121,19 @@
return isTenPointFiveReleaseOrNewer();
}
+ public String getForUpdateString() {
+ return " for update with rs";
+ }
+
+ public String getWriteLockString(int timeout) {
+ return " for update with rs";
+ }
+
+ public String getReadLockString(int timeout) {
+ return " for read only with rs";
+ }
+
+
/**
* {@inheritDoc}
* <p/>
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/Dialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/Dialect.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/Dialect.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -978,9 +978,15 @@
*/
public String getForUpdateString(LockOptions lockOptions) {
LockMode lockMode = lockOptions.getLockMode();
- if ( lockMode==LockMode.UPGRADE || lockMode==LockMode.PESSIMISTIC_READ || lockMode==LockMode.PESSIMISTIC_WRITE) {
+ if ( lockMode==LockMode.UPGRADE) {
return getForUpdateString();
}
+ else if( lockMode==LockMode.PESSIMISTIC_READ ) {
+ return getReadLockString(lockOptions.getTimeOut());
+ }
+ else if( lockMode==LockMode.PESSIMISTIC_WRITE ) {
+ return getWriteLockString(lockOptions.getTimeOut());
+ }
else if ( lockMode==LockMode.UPGRADE_NOWAIT ) {
return getForUpdateNowaitString();
}
@@ -999,9 +1005,15 @@
* @return The appropriate for update fragment.
*/
public String getForUpdateString(LockMode lockMode) {
- if ( lockMode==LockMode.UPGRADE || lockMode==LockMode.PESSIMISTIC_READ || lockMode==LockMode.PESSIMISTIC_WRITE) {
+ if ( lockMode==LockMode.UPGRADE ) {
return getForUpdateString();
}
+ else if( lockMode==LockMode.PESSIMISTIC_READ ) {
+ return getReadLockString(LockOptions.WAIT_FOREVER);
+ }
+ else if( lockMode==LockMode.PESSIMISTIC_WRITE ) {
+ return getWriteLockString(LockOptions.WAIT_FOREVER);
+ }
else if ( lockMode==LockMode.UPGRADE_NOWAIT ) {
return getForUpdateNowaitString();
}
@@ -1024,6 +1036,31 @@
}
/**
+ * Get the string to append to SELECT statements to acquire WRITE locks
+ * for this dialect. Location of the of the returned string is treated
+ * the same as getForUpdateString.
+ *
+ * @param timeout in milliseconds, -1 for indefinite wait and 0 for no wait.
+ * @return The appropriate <tt>LOCK</tt> clause string.
+ */
+ public String getWriteLockString(int timeout) {
+ return getForUpdateString();
+ }
+
+ /**
+ * Get the string to append to SELECT statements to acquire WRITE locks
+ * for this dialect. Location of the of the returned string is treated
+ * the same as getForUpdateString.
+ *
+ * @param timeout in milliseconds, -1 for indefinite wait and 0 for no wait.
+ * @return The appropriate <tt>LOCK</tt> clause string.
+ */
+ public String getReadLockString(int timeout) {
+ return getForUpdateString();
+ }
+
+
+ /**
* Is <tt>FOR UPDATE OF</tt> syntax supported?
*
* @return True if the database supports <tt>FOR UPDATE OF</tt> syntax;
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadSelectLockingStrategy.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadSelectLockingStrategy.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadSelectLockingStrategy.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -27,12 +27,13 @@
import org.hibernate.persister.entity.Lockable;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.StaleObjectStateException;
-import org.hibernate.JDBCException;
-import org.hibernate.LockMode;
import org.hibernate.sql.SimpleSelect;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.exception.JDBCExceptionHelper;
+import org.hibernate.LockMode;
+import org.hibernate.StaleObjectStateException;
+import org.hibernate.JDBCException;
+import org.hibernate.PessimisticLockException;
import java.io.Serializable;
import java.sql.PreparedStatement;
@@ -117,12 +118,13 @@
}
catch ( SQLException sqle ) {
- throw JDBCExceptionHelper.convert(
+ JDBCException e = JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
sqle,
"could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
sql
);
+ throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadUpdateLockingStrategy.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadUpdateLockingStrategy.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticReadUpdateLockingStrategy.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -28,16 +28,17 @@
import java.sql.PreparedStatement;
import java.sql.SQLException;
-import org.hibernate.HibernateException;
-import org.hibernate.JDBCException;
-import org.hibernate.LockMode;
-import org.hibernate.StaleObjectStateException;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.sql.Update;
+import org.hibernate.LockMode;
+import org.hibernate.HibernateException;
+import org.hibernate.StaleObjectStateException;
+import org.hibernate.JDBCException;
+import org.hibernate.PessimisticLockException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -120,12 +121,13 @@
}
catch ( SQLException sqle ) {
- throw JDBCExceptionHelper.convert(
+ JDBCException e = JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
- sqle,
- "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
- sql
- );
+ sqle,
+ "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
+ sql
+ );
+ throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteSelectLockingStrategy.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteSelectLockingStrategy.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteSelectLockingStrategy.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -30,6 +30,7 @@
import org.hibernate.StaleObjectStateException;
import org.hibernate.JDBCException;
import org.hibernate.LockMode;
+import org.hibernate.PessimisticLockException;
import org.hibernate.sql.SimpleSelect;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.exception.JDBCExceptionHelper;
@@ -117,12 +118,13 @@
}
catch ( SQLException sqle ) {
- throw JDBCExceptionHelper.convert(
+ JDBCException e = JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
sqle,
"could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
sql
);
+ throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteUpdateLockingStrategy.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteUpdateLockingStrategy.java 2009-12-09 21:41:12 UTC (rev 18188)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/lock/PessimisticWriteUpdateLockingStrategy.java 2009-12-10 00:33:22 UTC (rev 18189)
@@ -28,16 +28,17 @@
import java.sql.PreparedStatement;
import java.sql.SQLException;
-import org.hibernate.HibernateException;
-import org.hibernate.JDBCException;
-import org.hibernate.LockMode;
-import org.hibernate.StaleObjectStateException;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.sql.Update;
+import org.hibernate.LockMode;
+import org.hibernate.HibernateException;
+import org.hibernate.StaleObjectStateException;
+import org.hibernate.JDBCException;
+import org.hibernate.PessimisticLockException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -120,12 +121,13 @@
}
catch ( SQLException sqle ) {
- throw JDBCExceptionHelper.convert(
+ JDBCException e = JDBCExceptionHelper.convert(
session.getFactory().getSQLExceptionConverter(),
- sqle,
- "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
- sql
- );
+ sqle,
+ "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
+ sql
+ );
+ throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
}
}
15 years
Hibernate SVN: r18188 - in validator/trunk: hibernate-validator-tck-runner and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-09 16:41:12 -0500 (Wed, 09 Dec 2009)
New Revision: 18188
Modified:
validator/trunk/hibernate-validator-archetype/pom.xml
validator/trunk/hibernate-validator-tck-runner/pom.xml
Log:
HV-272
Modified: validator/trunk/hibernate-validator-archetype/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-archetype/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
+++ validator/trunk/hibernate-validator-archetype/pom.xml 2009-12-09 21:41:12 UTC (rev 18188)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hibernate-validator-parent</artifactId>
@@ -25,8 +27,22 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>${project.parent.version}</version>
</dependency>
+ <!--
+ Provided dependencies.
+ JAXB is needed when running on Java5. In this environment these dependencies have to be added
+ On Java6 jaxb is part of the runtime environment
+ -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
<defaultGoal>test</defaultGoal>
Modified: validator/trunk/hibernate-validator-tck-runner/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
+++ validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-09 21:41:12 UTC (rev 18188)
@@ -19,7 +19,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
@@ -38,6 +38,21 @@
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-jboss-as-51</artifactId>
</dependency>
+ <!--
+ Provided dependencies.
+ JAXB is needed when running on Java5. In this environment these dependencies have to be added
+ On Java6 jaxb is part of the runtime environment
+ -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<properties>
15 years
Hibernate SVN: r18187 - in validator/trunk: hibernate-validator and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-09 16:11:03 -0500 (Wed, 09 Dec 2009)
New Revision: 18187
Modified:
validator/trunk/hibernate-validator-annotation-processor/pom.xml
validator/trunk/hibernate-validator-legacy/pom.xml
validator/trunk/hibernate-validator-tck-runner/pom.xml
validator/trunk/hibernate-validator/pom.xml
validator/trunk/pom.xml
Log:
HV-276 moved all plugin version and dependency version configuration into the parent pom
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-12-09 21:09:28 UTC (rev 18186)
+++ validator/trunk/hibernate-validator/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
@@ -1,4 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
@@ -30,7 +32,6 @@
<dependency>
<groupId>com.googlecode.jtype</groupId>
<artifactId>jtype</artifactId>
- <version>0.1.1</version>
</dependency>
<!--
@@ -51,13 +52,11 @@
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
- <version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
- <version>2.1.12</version>
<scope>provided</scope>
</dependency>
@@ -67,7 +66,6 @@
<dependency>
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
- <version>2.0-cr-1</version>
<optional>true</optional>
</dependency>
@@ -95,22 +93,12 @@
</resources>
<plugins>
<plugin>
- <inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
- <version>1.3</version>
<executions>
<execution>
<goals>
@@ -136,19 +124,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-test-report</id>
- <phase>test</phase>
- <goals>
- <goal>report-only</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
- <outputName>test-report</outputName>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -172,7 +147,7 @@
</relocation>
</relocations>
<transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"/>
</transformers>
</configuration>
</execution>
@@ -181,7 +156,6 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
<extensions>true</extensions>
<dependencies>
<dependency>
@@ -240,7 +214,6 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-style-plugin</artifactId>
- <version>2.0.0</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@@ -260,17 +233,18 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <goals>javadoc:javadoc org.jboss.maven.plugins:maven-jdocbook-plugin:2.2.0:resources
+ org.jboss.maven.plugins:maven-jdocbook-plugin:2.2.0:generate assembly:assembly deploy
+ </goals>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.twdata.maven</groupId>
<artifactId>maven-cli-plugin</artifactId>
- <version>0.6.3.CR3</version>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <goals>javadoc:javadoc org.jboss.maven.plugins:maven-jdocbook-plugin:2.2.0:resources org.jboss.maven.plugins:maven-jdocbook-plugin:2.2.0:generate assembly:assembly deploy</goals>
- </configuration>
- </plugin>
</plugins>
</build>
<reporting>
@@ -278,7 +252,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.0.1</version>
</plugin>
</plugins>
</reporting>
Modified: validator/trunk/hibernate-validator-annotation-processor/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/pom.xml 2009-12-09 21:09:28 UTC (rev 18186)
+++ validator/trunk/hibernate-validator-annotation-processor/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hibernate-validator-parent</artifactId>
@@ -11,8 +13,8 @@
<artifactId>hibernate-validator-annotation-processor</artifactId>
<name>Hibernate Validator Annotation Processor</name>
<build>
- <plugins>
- <plugin>
+ <plugins>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
@@ -42,7 +44,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -59,24 +61,22 @@
TODO GM: find a better way to solve this issue
-->
<property>
- <name>pathToBeanValidationApiJar</name>
- <value>${project.build.directory}/lib/validation-api.jar</value>
+ <name>pathToBeanValidationApiJar</name>
+ <value>${project.build.directory}/lib/validation-api.jar</value>
</property>
</systemProperties>
</configuration>
</plugin>
- </plugins>
+ </plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.8</version>
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
Modified: validator/trunk/hibernate-validator-legacy/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-legacy/pom.xml 2009-12-09 21:09:28 UTC (rev 18186)
+++ validator/trunk/hibernate-validator-legacy/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
@@ -1,5 +1,7 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hibernate-validator-parent</artifactId>
@@ -21,7 +23,7 @@
<description>Following the DRY (Don't Repeat Yourself) principle, Hibernate Validator let's you express your domain
constraints once (and only once) and ensure their compliance at various level of your system automatically.
</description>
-
+
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
@@ -121,7 +123,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
- <stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
+ <stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
</configuration>
<executions>
<execution>
Modified: validator/trunk/hibernate-validator-tck-runner/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-09 21:09:28 UTC (rev 18186)
+++ validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
@@ -1,4 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
@@ -17,7 +19,6 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>${version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -32,19 +33,17 @@
<dependency>
<groupId>org.hibernate.jsr303.tck</groupId>
<artifactId>jsr303-tck</artifactId>
- <version>1.0.3.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-jboss-as-51</artifactId>
- <version>1.0.0</version>
</dependency>
</dependencies>
<properties>
<jboss.home>/opt/java/jboss-5.1.0.GA</jboss.home>
<validation.provider>org.hibernate.validator.HibernateValidator</validation.provider>
- <remote.debug />
+ <remote.debug/>
</properties>
<build>
Modified: validator/trunk/pom.xml
===================================================================
--- validator/trunk/pom.xml 2009-12-09 21:09:28 UTC (rev 18186)
+++ validator/trunk/pom.xml 2009-12-09 21:11:03 UTC (rev 18187)
@@ -1,4 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-parent</artifactId>
@@ -46,11 +48,28 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.12</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.6</version>
@@ -59,13 +78,35 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>com.googlecode.jtype</groupId>
+ <artifactId>jtype</artifactId>
+ <version>0.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.java-persistence</groupId>
+ <artifactId>jpa-api</artifactId>
+ <version>2.0-cr-1</version>
+ </dependency>
+ <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.8</version>
<classifier>jdk15</classifier>
+ <scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hibernate.jsr303.tck</groupId>
+ <artifactId>jsr303-tck</artifactId>
+ <version>1.0.3.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-as-51</artifactId>
+ <version>1.0.0</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -78,27 +119,28 @@
</extension>
</extensions>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-java</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <rules>
- <requireJavaVersion>
- <!-- require JDK 1.6 to run the build -->
- <version>[1.6,)</version>
- </requireJavaVersion>
- </rules>
- </configuration>
- </plugin>
- </plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <executions>
+ <execution>
+ <id>enforce-java</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <!-- require JDK 1.6 to run the build -->
+ <version>[1.6,)</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </plugin>
+ </plugins>
<pluginManagement>
<plugins>
<plugin>
@@ -130,6 +172,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
<configuration>
<forkMode>always</forkMode>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
@@ -139,7 +182,27 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ <executions>
+ <execution>
+ <id>generate-test-report</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report-only</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+ <outputName>test-report</outputName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
+ <version>2.1.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -150,7 +213,14 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-4</version>
<configuration>
<descriptorRefs>
<descriptorRef>project</descriptorRef>
@@ -169,6 +239,41 @@
<goals>deploy</goals>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxb2-maven-plugin</artifactId>
+ <version>1.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-style-plugin</artifactId>
+ <version>2.0.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.0.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>0.6.3.CR2</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
15 years