You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by db...@apache.org on 2006/12/21 05:15:08 UTC
svn commit: r489260 -
/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/
Author: dblevins
Date: Wed Dec 20 20:15:07 2006
New Revision: 489260
URL: http://svn.apache.org/viewvc?view=rev&rev=489260
Log:
Fixed to be 100% compliant with EJB 3.0 Persistence API
Modified:
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityExistsException.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityNotFoundException.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NoResultException.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NonUniqueResultException.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/OptimisticLockException.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Persistence.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Query.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/SqlResultSetMapping.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Temporal.java
geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/TransactionRequiredException.java
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityExistsException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityExistsException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityExistsException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityExistsException.java Wed Dec 20 20:15:07 2006
@@ -27,7 +27,7 @@
/**
* @version $Revision$ $Date$
*/
-public class EntityExistsException extends RuntimeException {
+public class EntityExistsException extends PersistenceException {
public EntityExistsException() {
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityNotFoundException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityNotFoundException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityNotFoundException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/EntityNotFoundException.java Wed Dec 20 20:15:07 2006
@@ -28,7 +28,7 @@
/**
* @version $Rev$ $Date$
*/
-public class EntityNotFoundException extends RuntimeException {
+public class EntityNotFoundException extends PersistenceException {
/**
*
@@ -43,11 +43,4 @@
super(message);
}
- public EntityNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public EntityNotFoundException(Throwable cause) {
- super(cause);
- }
}
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NoResultException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NoResultException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NoResultException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NoResultException.java Wed Dec 20 20:15:07 2006
@@ -27,7 +27,7 @@
/**
* @version $Rev$ $Date$
*/
-public class NoResultException extends RuntimeException {
+public class NoResultException extends PersistenceException {
/**
*
@@ -40,14 +40,6 @@
public NoResultException(String message) {
super(message);
- }
-
- public NoResultException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public NoResultException(Throwable cause) {
- super(cause);
}
}
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NonUniqueResultException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NonUniqueResultException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NonUniqueResultException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/NonUniqueResultException.java Wed Dec 20 20:15:07 2006
@@ -28,7 +28,7 @@
/**
* @version $Rev$ $Date$
*/
-public class NonUniqueResultException extends RuntimeException {
+public class NonUniqueResultException extends PersistenceException {
/**
*
@@ -41,14 +41,6 @@
public NonUniqueResultException(String message) {
super(message);
- }
-
- public NonUniqueResultException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public NonUniqueResultException(Throwable cause) {
- super(cause);
}
}
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/OptimisticLockException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/OptimisticLockException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/OptimisticLockException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/OptimisticLockException.java Wed Dec 20 20:15:07 2006
@@ -25,19 +25,38 @@
package javax.persistence;
public class OptimisticLockException extends PersistenceException {
+ private final Object entity;
+
public OptimisticLockException() {
+ this.entity = null;
+ }
+
+ public OptimisticLockException(Object entity){
+ super();
+ this.entity = entity;
}
public OptimisticLockException(String string) {
super(string);
+ this.entity = null;
}
public OptimisticLockException(String string, Throwable throwable) {
super(string, throwable);
+ this.entity = null;
+ }
+
+ public OptimisticLockException(String string, Throwable throwable, Object entity) {
+ super(string, throwable);
+ this.entity = entity;
}
public OptimisticLockException(Throwable throwable) {
super(throwable);
+ this.entity = null;
}
+ public Object getEntity() {
+ return entity;
+ }
}
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Persistence.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Persistence.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Persistence.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Persistence.java Wed Dec 20 20:15:07 2006
@@ -31,6 +31,8 @@
import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;
+import java.util.HashSet;
+import java.util.Set;
import javax.persistence.spi.PersistenceProvider;
@@ -44,6 +46,9 @@
*/
public class Persistence {
+ protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
+
+ public static java.lang.String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName();
static final String PERSISTENCE_PROVIDER_PROPERTY = "javax.persistence.provider";
static final String PERSISTENCE_PROVIDER_SERVICE = "META-INF/services/"
+ PersistenceProvider.class.getName();
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Query.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Query.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Query.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Query.java Wed Dec 20 20:15:07 2006
@@ -43,6 +43,8 @@
public Query setFirstResult(int startPosition);
+ public Query setFlushMode(FlushModeType flushModeType);
+
public Query setHint(String hintName, Object value);
public Query setParameter(String name, Object value);
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/SqlResultSetMapping.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/SqlResultSetMapping.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/SqlResultSetMapping.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/SqlResultSetMapping.java Wed Dec 20 20:15:07 2006
@@ -32,7 +32,7 @@
/**
* @version $Rev$ $Date$
*/
-@Target({ElementType.TYPE, ElementType.METHOD})
+@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface SqlResultSetMapping {
String name();
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Temporal.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Temporal.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Temporal.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/Temporal.java Wed Dec 20 20:15:07 2006
@@ -35,5 +35,5 @@
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Temporal {
- TemporalType value() default TemporalType.TIMESTAMP;
+ TemporalType value();
}
Modified: geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/TransactionRequiredException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/TransactionRequiredException.java?view=diff&rev=489260&r1=489259&r2=489260
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/TransactionRequiredException.java (original)
+++ geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/TransactionRequiredException.java Wed Dec 20 20:15:07 2006
@@ -27,7 +27,7 @@
/**
* @version $Rev$ $Date$
*/
-public class TransactionRequiredException extends RuntimeException {
+public class TransactionRequiredException extends PersistenceException {
/**
*
*/
@@ -41,11 +41,4 @@
super(string);
}
- public TransactionRequiredException(String string, Throwable throwable) {
- super(string, throwable);
- }
-
- public TransactionRequiredException(Throwable throwable) {
- super(throwable);
- }
}