mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - code cleanup - remove unused - objects
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import com.avaje.ebean.bean.PersistenceContext;
|
||||
import com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
|
||||
/**
|
||||
* Provides context when performing a bean copy.
|
||||
*
|
||||
* @author rbygrave
|
||||
*/
|
||||
public class CopyContext {
|
||||
|
||||
private final boolean vanillaMode;
|
||||
|
||||
private final boolean sharing;
|
||||
|
||||
private final PersistenceContext pc;
|
||||
|
||||
public CopyContext(boolean vanillaMode, boolean sharing) {
|
||||
this.vanillaMode = vanillaMode;
|
||||
this.sharing = sharing;
|
||||
this.pc = new DefaultPersistenceContext();
|
||||
}
|
||||
|
||||
public CopyContext(boolean vanillaMode) {
|
||||
this(vanillaMode, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the copy should be a vanilla bean.
|
||||
*/
|
||||
public boolean isVanillaMode() {
|
||||
return vanillaMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the copy should be safe for sharing.
|
||||
*/
|
||||
public boolean isSharing() {
|
||||
return sharing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the persistence context used during the copy.
|
||||
*/
|
||||
public PersistenceContext getPersistenceContext() {
|
||||
return pc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put the bean if absent into the persistence context.
|
||||
*/
|
||||
public Object putIfAbsent(Object id, Object bean){
|
||||
return pc.putIfAbsent(id, bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the bean for the given type and id from the persistence context.
|
||||
*/
|
||||
public Object get(Class<?> beanType, Object beanId){
|
||||
return pc.get(beanType, beanId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.avaje.ebeaninternal.server.lib.util;
|
||||
|
||||
|
||||
/**
|
||||
* A general exception when creating an Object.
|
||||
*/
|
||||
public class CreateObjectException extends RuntimeException
|
||||
{
|
||||
static final long serialVersionUID = 7061559938704539736L;
|
||||
|
||||
public CreateObjectException(Exception cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public CreateObjectException(String s, Exception cause) {
|
||||
super(s, cause);
|
||||
}
|
||||
|
||||
public CreateObjectException(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user