Skip to content

Commit

Permalink
Merge pull request #1243 from scottmarlow/jpa3.2_add_new_methods
Browse files Browse the repository at this point in the history
Add new Persistence 3.2 methods to address build failures
  • Loading branch information
scottmarlow authored Mar 6, 2024
2 parents 352be01 + 86ee234 commit 8f10037
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public boolean isActive() {
return delegate.isActive();
}

@Override
public void setTimeout(Integer timeout) {
delegate.setTimeout(timeout);
}

@Override
public Integer getTimeout() {
return delegate.getTimeout();
}

public void commit() {
delegate.commit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public boolean isActive() {
return true;
}

@Override
public void setTimeout(Integer timeout) {

}

@Override
public Integer getTimeout() {
return null;
}

public void commit() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ public boolean isActive() {
return active;
}

@Override
public void setTimeout(Integer timeout) {

}

@Override
public Integer getTimeout() {
return null;
}

public void commit() {
TestUtil.logTrace("in UserTransactionWrapper.commit()");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@
package ee.jakarta.tck.persistence.common.pluggability.altprovider.implementation;

import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;

import jakarta.persistence.Cache;
import jakarta.persistence.EntityGraph;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceUnitTransactionType;
import jakarta.persistence.PersistenceUnitUtil;
import jakarta.persistence.Query;
import jakarta.persistence.SchemaManager;
import jakarta.persistence.TypedQueryReference;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.metamodel.Metamodel;
import jakarta.persistence.spi.PersistenceUnitInfo;
Expand Down Expand Up @@ -66,6 +71,11 @@ public void close() {
isOpen = false;
}

@Override
public String getName() {
return null;
}

public EntityManager createEntityManager() {
logger.log("Called EntityManagerFactoryImpl.createEntityManager()");
verifyOpen();
Expand Down Expand Up @@ -118,6 +128,16 @@ public PersistenceUnitUtil getPersistenceUnitUtil() {
return null;
}

@Override
public PersistenceUnitTransactionType getTransactionType() {
return null;
}

@Override
public SchemaManager getSchemaManager() {
return null;
}

public Map<String, Object> getProperties() {
return null;
}
Expand All @@ -133,6 +153,26 @@ public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph

}

@Override
public <R> Map<String, TypedQueryReference<R>> getNamedQueries(Class<R> resultType) {
return null;
}

@Override
public <E> Map<String, EntityGraph<? extends E>> getNamedEntityGraphs(Class<E> entityType) {
return null;
}

@Override
public void runInTransaction(Consumer<EntityManager> work) {

}

@Override
public <R> R callInTransaction(Function<EntityManager, R> work) {
return null;
}

public boolean isOpen() {
return isOpen;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,26 @@
import java.util.List;
import java.util.Map;

import jakarta.persistence.CacheRetrieveMode;
import jakarta.persistence.CacheStoreMode;
import jakarta.persistence.ConnectionConsumer;
import jakarta.persistence.ConnectionFunction;
import jakarta.persistence.EntityGraph;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.EntityTransaction;
import jakarta.persistence.FindOption;
import jakarta.persistence.FlushModeType;
import jakarta.persistence.LockModeType;
import jakarta.persistence.LockOption;
import jakarta.persistence.Query;
import jakarta.persistence.RefreshOption;
import jakarta.persistence.StoredProcedureQuery;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.TypedQueryReference;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaDelete;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.CriteriaSelect;
import jakarta.persistence.criteria.CriteriaUpdate;
import jakarta.persistence.metamodel.Metamodel;

Expand Down Expand Up @@ -87,6 +96,11 @@ public <T> TypedQuery<T> createNamedQuery(String arg0, Class<T> arg1) {
return (TypedQuery<T>) query;
}

@Override
public <T> TypedQuery<T> createQuery(TypedQueryReference<T> reference) {
return null;
}

@Override
public Query createNativeQuery(String arg0) {
QueryImpl query = new QueryImpl();
Expand Down Expand Up @@ -122,6 +136,11 @@ public <T> TypedQuery<T> createQuery(CriteriaQuery<T> arg0) {
return null;
}

@Override
public <T> TypedQuery<T> createQuery(CriteriaSelect<T> selectQuery) {
return null;
}

@Override
public <T> TypedQuery<T> createQuery(String arg0, Class<T> arg1) {
QueryImpl query = new QueryImpl();
Expand Down Expand Up @@ -185,6 +204,16 @@ public <T> T find(Class<T> arg0, Object arg1, LockModeType arg2, Map<String, Obj
return null;
}

@Override
public <T> T find(Class<T> entityClass, Object primaryKey, FindOption... options) {
return null;
}

@Override
public <T> T find(EntityGraph<T> entityGraph, Object primaryKey, FindOption... options) {
return null;
}

@Override
public void flush() {

Expand Down Expand Up @@ -216,6 +245,26 @@ public LockModeType getLockMode(Object arg0) {
return null;
}

@Override
public void setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode) {

}

@Override
public void setCacheStoreMode(CacheStoreMode cacheStoreMode) {

}

@Override
public CacheRetrieveMode getCacheRetrieveMode() {
return null;
}

@Override
public CacheStoreMode getCacheStoreMode() {
return null;
}

@Override
public Metamodel getMetamodel() {
return null;
Expand All @@ -231,6 +280,11 @@ public <T> T getReference(Class<T> arg0, Object arg1) {
return null;
}

@Override
public <T> T getReference(T entity) {
return null;
}

@Override
public EntityTransaction getTransaction() {
logger.log("Called EntityManagerImpl.getTransaction()");
Expand Down Expand Up @@ -265,6 +319,11 @@ public void lock(Object arg0, LockModeType arg1, Map<String, Object> arg2) {

}

@Override
public void lock(Object entity, LockModeType lockMode, LockOption... options) {

}

@Override
public <T> T merge(T arg0) {
return arg0;// not cloning it in case the object can't be cloned
Expand Down Expand Up @@ -295,6 +354,11 @@ public void refresh(Object arg0, LockModeType arg1, Map<String, Object> arg2) {

}

@Override
public void refresh(Object entity, RefreshOption... options) {

}

@Override
public void remove(Object arg0) {

Expand Down Expand Up @@ -322,6 +386,16 @@ public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass) {
return null;
}

@Override
public <C> void runWithConnection(ConnectionConsumer<C> action) {

}

@Override
public <C, T> T callWithConnection(ConnectionFunction<C, T> function) {
return null;
}

public EntityGraph<?> getEntityGraph(String graphName) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public boolean isActive() {
return this.isActive;
}

@Override
public void setTimeout(Integer timeout) {

}

@Override
public Integer getTimeout() {
return null;
}

@Override
public void rollback() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Set;

import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.PersistenceConfiguration;
import jakarta.persistence.spi.LoadState;
import jakarta.persistence.spi.PersistenceProviderResolver;
import jakarta.persistence.spi.PersistenceProviderResolverHolder;
Expand All @@ -38,7 +39,7 @@ public class PersistenceProvider
// Used to store static PersistenceUnitInfo where this is the provider
static Map<String, PersistenceUnitInfoImpl> puInfoMap;

static private PersistenceProvider provider = new PersistenceProvider();
static private final PersistenceProvider provider = new PersistenceProvider();

protected TSLogger logger;

Expand Down Expand Up @@ -150,6 +151,11 @@ public EntityManagerFactory createEntityManagerFactory(String puName, Map proper
return emf;
}

@Override
public EntityManagerFactory createEntityManagerFactory(PersistenceConfiguration configuration) {
return null;
}

public ProviderUtil getProviderUtil() {
callLogger("Called getProviderUtil()");
return provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ public String getPersistenceProviderClassName() {
return persistenceProviderClassName;
}

@Override
public String getScopeAnnotationName() {
return null;
}

@Override
public List<String> getQualifierAnnotationNames() {
return null;
}

@Override
public String getPersistenceUnitName() {
logger.log("Called PersistenceUnitInfoImpl.getPersistenceUnitName()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.util.Map;
import java.util.Set;

import jakarta.persistence.CacheRetrieveMode;
import jakarta.persistence.CacheStoreMode;
import jakarta.persistence.FlushModeType;
import jakarta.persistence.LockModeType;
import jakarta.persistence.Parameter;
Expand Down Expand Up @@ -125,6 +127,11 @@ public X getSingleResult() {
return null;
}

@Override
public X getSingleResultOrNull() {
return null;
}

@Override
public boolean isBound(Parameter<?> arg0) {
return false;
Expand All @@ -150,6 +157,36 @@ public TypedQuery setLockMode(LockModeType arg0) {
return this;
}

@Override
public TypedQuery<X> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode) {
return null;
}

@Override
public TypedQuery<X> setCacheStoreMode(CacheStoreMode cacheStoreMode) {
return null;
}

@Override
public CacheRetrieveMode getCacheRetrieveMode() {
return null;
}

@Override
public CacheStoreMode getCacheStoreMode() {
return null;
}

@Override
public TypedQuery<X> setTimeout(Integer timeout) {
return null;
}

@Override
public Integer getTimeout() {
return null;
}

@Override
public TypedQuery setMaxResults(int arg0) {
return this;
Expand Down

0 comments on commit 8f10037

Please sign in to comment.