mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 17:15:02 +00:00
HHH-2879 Make IdentifierLoadAccess the primary API
HHH-2879 Update all load and get APIs to use byId and IdentifierLoadAccess
This commit is contained in:
parent
60b6c7f5eb
commit
2d03ca322d
@ -796,7 +796,7 @@ public interface Session extends SharedSessionContract {
|
|||||||
* @param entityName The name of the entity that will be retrieved
|
* @param entityName The name of the entity that will be retrieved
|
||||||
* @throws HibernateException If the specified entity name is not found or if the entity does not have a natural id specified
|
* @throws HibernateException If the specified entity name is not found or if the entity does not have a natural id specified
|
||||||
*/
|
*/
|
||||||
public NaturalIdLoadAccess<Object> byNaturalKey(String entityName);
|
public NaturalIdLoadAccess<Object> byNaturalId(String entityName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an {@link NaturalIdLoadAccess} instance to retrieve the specified entity by
|
* Create an {@link NaturalIdLoadAccess} instance to retrieve the specified entity by
|
||||||
@ -805,7 +805,7 @@ public interface Session extends SharedSessionContract {
|
|||||||
* @param entityClass The type of the entity that will be retrieved
|
* @param entityClass The type of the entity that will be retrieved
|
||||||
* @throws HibernateException If the specified Class is not an entity or if the entity does not have a natural id specified
|
* @throws HibernateException If the specified Class is not an entity or if the entity does not have a natural id specified
|
||||||
*/
|
*/
|
||||||
public <T> NaturalIdLoadAccess<T> byNaturalKey(Class<T> entityClass);
|
public <T> NaturalIdLoadAccess<T> byNaturalId(Class<T> entityClass);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable the named filter for this current session.
|
* Enable the named filter for this current session.
|
||||||
|
@ -842,40 +842,19 @@ public void load(Object object, Serializable id) throws HibernateException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Object load(Class entityClass, Serializable id) throws HibernateException {
|
public Object load(Class entityClass, Serializable id) throws HibernateException {
|
||||||
return load( entityClass.getName(), id );
|
return this.byId(entityClass).getReference(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object load(String entityName, Serializable id) throws HibernateException {
|
public Object load(String entityName, Serializable id) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, false, this);
|
return this.byId(entityName).getReference(id);
|
||||||
boolean success = false;
|
|
||||||
try {
|
|
||||||
fireLoad( event, LoadEventListener.LOAD );
|
|
||||||
if ( event.getResult() == null ) {
|
|
||||||
getFactory().getEntityNotFoundDelegate().handleEntityNotFound( entityName, id );
|
|
||||||
}
|
|
||||||
success = true;
|
|
||||||
return event.getResult();
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
afterOperation(success);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(Class entityClass, Serializable id) throws HibernateException {
|
public Object get(Class entityClass, Serializable id) throws HibernateException {
|
||||||
return get( entityClass.getName(), id );
|
return this.byId(entityClass).load(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String entityName, Serializable id) throws HibernateException {
|
public Object get(String entityName, Serializable id) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, false, this);
|
return this.byId(entityName).load(id);
|
||||||
boolean success = false;
|
|
||||||
try {
|
|
||||||
fireLoad(event, LoadEventListener.GET);
|
|
||||||
success = true;
|
|
||||||
return event.getResult();
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
afterOperation(success);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -910,75 +889,67 @@ public Object internalLoad(String entityName, Serializable id, boolean eager, bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Object load(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
|
public Object load(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
|
||||||
return load( entityClass.getName(), id, lockMode );
|
return this.byId(entityClass).with(lockMode).getReference(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object load(Class entityClass, Serializable id, LockOptions lockOptions) throws HibernateException {
|
public Object load(Class entityClass, Serializable id, LockOptions lockOptions) throws HibernateException {
|
||||||
return load( entityClass.getName(), id, lockOptions );
|
return this.byId(entityClass).with(lockOptions).getReference(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
|
public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, lockMode, this);
|
return this.byId(entityName).with(lockMode).getReference(id);
|
||||||
fireLoad( event, LoadEventListener.LOAD );
|
|
||||||
return event.getResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object load(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException {
|
public Object load(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, lockOptions, this);
|
return this.byId(entityName).with(lockOptions).getReference(id);
|
||||||
fireLoad( event, LoadEventListener.LOAD );
|
|
||||||
return event.getResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
|
public Object get(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
|
||||||
return get( entityClass.getName(), id, lockMode );
|
return this.byId(entityClass).with(lockMode).load(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(Class entityClass, Serializable id, LockOptions lockOptions) throws HibernateException {
|
public Object get(Class entityClass, Serializable id, LockOptions lockOptions) throws HibernateException {
|
||||||
return get( entityClass.getName(), id, lockOptions );
|
return this.byId(entityClass).with(lockOptions).load(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
|
public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, lockMode, this);
|
return this.byId(entityName).with(lockMode).load(id);
|
||||||
fireLoad(event, LoadEventListener.GET);
|
|
||||||
return event.getResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException {
|
public Object get(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException {
|
||||||
LoadEvent event = new LoadEvent(id, entityName, lockOptions, this);
|
return this.byId(entityName).with(lockOptions).load(id);
|
||||||
fireLoad( event, LoadEventListener.GET );
|
|
||||||
return event.getResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.Session#byId(java.lang.String)
|
* @see org.hibernate.Session#byId(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IdentifierLoadAccess<Object> byId(String entityName) {
|
public IdentifierLoadAccessImpl<Object> byId(String entityName) {
|
||||||
return new IdentifierLoadAccessByName(entityName);
|
return new IdentifierLoadAccessImpl<Object>(entityName, Object.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.Session#byId(java.lang.Class)
|
* @see org.hibernate.Session#byId(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public <T> IdentifierLoadAccess<T> byId(Class<T> entityClass) {
|
public <T> IdentifierLoadAccessImpl<T> byId(Class<T> entityClass) {
|
||||||
return new IdentifierLoadAccessByClass<T>(entityClass);
|
return new IdentifierLoadAccessImpl<T>(entityClass.getName(), entityClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.Session#byNaturalKey(java.lang.String)
|
* @see org.hibernate.Session#byNaturalId(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public NaturalIdLoadAccess<Object> byNaturalKey(String entityName) {
|
public NaturalIdLoadAccess<Object> byNaturalId(String entityName) {
|
||||||
return new NaturalIdLoadAccessByName(entityName);
|
return new NaturalIdLoadAccessImpl<Object>(entityName, Object.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.Session#byNaturalKey(java.lang.Class)
|
* @see org.hibernate.Session#byNaturalId(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public <T> NaturalIdLoadAccess<T> byNaturalKey(Class<T> entityClass) {
|
public <T> NaturalIdLoadAccess<T> byNaturalId(Class<T> entityClass) {
|
||||||
return new NaturalIdLoadAccessByClass<T>(entityClass);
|
return new NaturalIdLoadAccessImpl<T>(entityClass.getName(), entityClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fireLoad(LoadEvent event, LoadType loadType) {
|
private void fireLoad(LoadEvent event, LoadType loadType) {
|
||||||
@ -2199,28 +2170,76 @@ public void lock(Object object) throws HibernateException {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private abstract class AbstractIdentifierLoadAccess<T> implements IdentifierLoadAccess<T> {
|
private class IdentifierLoadAccessImpl<T> implements IdentifierLoadAccess<T> {
|
||||||
|
private final String entityName;
|
||||||
|
private final Class<T> entityClass;
|
||||||
private LockOptions lockOptions;
|
private LockOptions lockOptions;
|
||||||
|
@Deprecated
|
||||||
|
private LockMode lockMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note that the specified entity MUST be castable using {@link Class#cast(Object)}
|
||||||
|
* on the specified entityClass
|
||||||
|
*/
|
||||||
|
private IdentifierLoadAccessImpl(String entityName, Class<T> entityClass) {
|
||||||
|
this.entityName = entityName;
|
||||||
|
this.entityClass = entityClass;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.IdentifierLoadAccess#with(org.hibernate.LockOptions)
|
* @see org.hibernate.IdentifierLoadAccess#with(org.hibernate.LockOptions)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final IdentifierLoadAccess<T> with(LockOptions lockOptions) {
|
public final IdentifierLoadAccessImpl<T> with(LockOptions lockOptions) {
|
||||||
|
if (this.lockMode != null) {
|
||||||
|
throw new IllegalArgumentException("Cannot specify by LockOptions and LockMode on a single IdentifierLoadAccessImpl");
|
||||||
|
}
|
||||||
this.lockOptions = lockOptions;
|
this.lockOptions = lockOptions;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support for legacy {@link Session#load(Class, Serializable, LockMode)} and {@link Session#load(String, Serializable, LockMode)
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public final IdentifierLoadAccessImpl<T> with(LockMode lockMode) {
|
||||||
|
if (this.lockOptions != null) {
|
||||||
|
throw new IllegalArgumentException("Cannot specify by LockOptions and LockMode on a single IdentifierLoadAccessImpl");
|
||||||
|
}
|
||||||
|
this.lockMode = lockMode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.IdentifierLoadAccess#getReference(java.io.Serializable)
|
* @see org.hibernate.IdentifierLoadAccess#getReference(java.io.Serializable)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final T getReference(Serializable id) {
|
public final T getReference(Serializable id) {
|
||||||
if (this.lockOptions != null) {
|
if (this.lockOptions != null) {
|
||||||
return getReferenceInternal(id, lockOptions);
|
LoadEvent event = new LoadEvent(id, entityName, lockOptions, SessionImpl.this);
|
||||||
|
fireLoad( event, LoadEventListener.LOAD );
|
||||||
|
return this.entityClass.cast(event.getResult());
|
||||||
|
}
|
||||||
|
if (this.lockMode != null) {
|
||||||
|
LoadEvent event = new LoadEvent(id, entityName, lockMode, SessionImpl.this);
|
||||||
|
fireLoad( event, LoadEventListener.LOAD );
|
||||||
|
return this.entityClass.cast(event.getResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
return getReferenceInternal(id);
|
LoadEvent event = new LoadEvent(id, entityName, false, SessionImpl.this);
|
||||||
|
boolean success = false;
|
||||||
|
try {
|
||||||
|
fireLoad( event, LoadEventListener.LOAD );
|
||||||
|
if ( event.getResult() == null ) {
|
||||||
|
getFactory().getEntityNotFoundDelegate().handleEntityNotFound( entityName, id );
|
||||||
|
}
|
||||||
|
success = true;
|
||||||
|
return this.entityClass.cast(event.getResult());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
afterOperation(success);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -2229,102 +2248,43 @@ public final T getReference(Serializable id) {
|
|||||||
@Override
|
@Override
|
||||||
public final T load(Serializable id) {
|
public final T load(Serializable id) {
|
||||||
if (this.lockOptions != null) {
|
if (this.lockOptions != null) {
|
||||||
return loadInternal(id, lockOptions);
|
LoadEvent event = new LoadEvent(id, entityName, lockOptions, SessionImpl.this);
|
||||||
|
fireLoad( event, LoadEventListener.GET );
|
||||||
|
return this.entityClass.cast(event.getResult());
|
||||||
}
|
}
|
||||||
|
if (this.lockMode != null) {
|
||||||
|
LoadEvent event = new LoadEvent(id, entityName, lockMode, SessionImpl.this);
|
||||||
|
fireLoad( event, LoadEventListener.GET );
|
||||||
|
return this.entityClass.cast(event.getResult());
|
||||||
|
}
|
||||||
|
|
||||||
return loadInternal(id);
|
LoadEvent event = new LoadEvent(id, entityName, false, SessionImpl.this);
|
||||||
}
|
boolean success = false;
|
||||||
|
try {
|
||||||
protected abstract T getReferenceInternal(Serializable id, LockOptions lockOptions);
|
fireLoad(event, LoadEventListener.GET);
|
||||||
protected abstract T getReferenceInternal(Serializable id);
|
success = true;
|
||||||
protected abstract T loadInternal(Serializable id, LockOptions lockOptions);
|
return this.entityClass.cast(event.getResult());
|
||||||
protected abstract T loadInternal(Serializable id);
|
}
|
||||||
}
|
finally {
|
||||||
|
afterOperation(success);
|
||||||
private class IdentifierLoadAccessByName extends AbstractIdentifierLoadAccess<Object> {
|
}
|
||||||
private final String entityName;
|
|
||||||
|
|
||||||
public IdentifierLoadAccessByName(String entityName) {
|
|
||||||
this.entityName = entityName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#getReferenceInternal(java.io.Serializable, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object getReferenceInternal(Serializable id, LockOptions lockOptions) {
|
|
||||||
return SessionImpl.this.load(entityName, id, lockOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#getReferenceInternal(java.io.Serializable)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object getReferenceInternal(Serializable id) {
|
|
||||||
return SessionImpl.this.load(entityName, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#loadInternal(java.io.Serializable, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object loadInternal(Serializable id, LockOptions lockOptions) {
|
|
||||||
return SessionImpl.this.get(entityName, id, lockOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#loadInternal(java.io.Serializable)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object loadInternal(Serializable id) {
|
|
||||||
return SessionImpl.this.get(entityName, id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class IdentifierLoadAccessByClass<T> extends AbstractIdentifierLoadAccess<T> {
|
private class NaturalIdLoadAccessImpl<T> implements NaturalIdLoadAccess<T> {
|
||||||
|
private final String entityName;
|
||||||
private final Class<T> entityClass;
|
private final Class<T> entityClass;
|
||||||
|
|
||||||
public IdentifierLoadAccessByClass(Class<T> entityName) {
|
|
||||||
this.entityClass = entityName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#getReferenceInternal(java.io.Serializable, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T getReferenceInternal(Serializable id, LockOptions lockOptions) {
|
|
||||||
return entityClass.cast(SessionImpl.this.load(entityClass, id, lockOptions));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#getReferenceInternal(java.io.Serializable)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T getReferenceInternal(Serializable id) {
|
|
||||||
return entityClass.cast(SessionImpl.this.load(entityClass, id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#loadInternal(java.io.Serializable, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T loadInternal(Serializable id, LockOptions lockOptions) {
|
|
||||||
return entityClass.cast(SessionImpl.this.get(entityClass, id, lockOptions));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractIdentifierLoadAccess#loadInternal(java.io.Serializable)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T loadInternal(Serializable id) {
|
|
||||||
return entityClass.cast(SessionImpl.this.get(entityClass, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private abstract class AbstractNaturalIdLoadAccess<T> implements NaturalIdLoadAccess<T> {
|
|
||||||
private final Map<String, Object> naturalIdParameters = new LinkedHashMap<String, Object>();
|
private final Map<String, Object> naturalIdParameters = new LinkedHashMap<String, Object>();
|
||||||
private LockOptions lockOptions;
|
private LockOptions lockOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note that the specified entity MUST be castable using {@link Class#cast(Object)}
|
||||||
|
* on the specified entityClass
|
||||||
|
*/
|
||||||
|
private NaturalIdLoadAccessImpl(String entityName, Class<T> entityClass) {
|
||||||
|
this.entityName = entityName;
|
||||||
|
this.entityClass = entityClass;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.hibernate.IdentifierLoadAccess#with(org.hibernate.LockOptions)
|
* @see org.hibernate.IdentifierLoadAccess#with(org.hibernate.LockOptions)
|
||||||
@ -2350,10 +2310,12 @@ public NaturalIdLoadAccess<T> using(String attributeName, Object value) {
|
|||||||
@Override
|
@Override
|
||||||
public final T getReference() {
|
public final T getReference() {
|
||||||
if (this.lockOptions != null) {
|
if (this.lockOptions != null) {
|
||||||
return getReferenceInternal(naturalIdParameters, lockOptions);
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
return getReferenceInternal(naturalIdParameters);
|
//TODO
|
||||||
|
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -2362,95 +2324,12 @@ public final T getReference() {
|
|||||||
@Override
|
@Override
|
||||||
public final T load() {
|
public final T load() {
|
||||||
if (this.lockOptions != null) {
|
if (this.lockOptions != null) {
|
||||||
return loadInternal(naturalIdParameters, lockOptions);
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
return loadInternal(naturalIdParameters);
|
//TODO
|
||||||
}
|
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
protected abstract T getReferenceInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions);
|
|
||||||
protected abstract T getReferenceInternal(Map<String, Object> naturalIdParameters);
|
|
||||||
protected abstract T loadInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions);
|
|
||||||
protected abstract T loadInternal(Map<String, Object> naturalIdParameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class NaturalIdLoadAccessByName extends AbstractNaturalIdLoadAccess<Object> {
|
|
||||||
private final String entityName;
|
|
||||||
|
|
||||||
public NaturalIdLoadAccessByName(String entityName) {
|
|
||||||
this.entityName = entityName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#getReferenceInternal(java.util.Map, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object getReferenceInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#getReferenceInternal(java.util.Map)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object getReferenceInternal(Map<String, Object> naturalIdParameters) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#loadInternal(java.util.Map, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object loadInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#loadInternal(java.util.Map)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected Object loadInternal(Map<String, Object> naturalIdParameters) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class NaturalIdLoadAccessByClass<T> extends AbstractNaturalIdLoadAccess<T> {
|
|
||||||
private final Class<T> entityClass;
|
|
||||||
|
|
||||||
public NaturalIdLoadAccessByClass(Class<T> entityName) {
|
|
||||||
this.entityClass = entityName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#getReferenceInternal(java.util.Map, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T getReferenceInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#getReferenceInternal(java.util.Map)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T getReferenceInternal(Map<String, Object> naturalIdParameters) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#loadInternal(java.util.Map, org.hibernate.LockOptions)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T loadInternal(Map<String, Object> naturalIdParameters, LockOptions lockOptions) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.hibernate.internal.SessionImpl.AbstractNaturalIdLoadAccess#loadInternal(java.util.Map)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected T loadInternal(Map<String, Object> naturalIdParameters) {
|
|
||||||
throw new UnsupportedOperationException("Not Implemented Yet");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user