mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
Fix for #201: Change BeanPersistListener to use isRegisterFor() method rather than generics type (just like BeanPersistController)
This commit is contained in:
1 parent
e04d6979d1
commit
c95d76d6f6
12 files changed
+215
-319
No files matched your search
@@ -112,11 +112,6 @@ public class DeployBeanDescriptor<T> {
|
||||
|
||||
private List<CompoundUniqueContraint> compoundUniqueConstraints;
|
||||
|
||||
/**
|
||||
* Extra deployment attributes.
|
||||
*/
|
||||
private HashMap<String, String> extraAttrMap = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* The base database table.
|
||||
*/
|
||||
@@ -136,7 +131,7 @@ public class DeployBeanDescriptor<T> {
|
||||
private Class<T> beanType;
|
||||
|
||||
private List<BeanPersistController> persistControllers = new ArrayList<BeanPersistController>(2);
|
||||
private List<BeanPersistListener<T>> persistListeners = new ArrayList<BeanPersistListener<T>>(2);
|
||||
private List<BeanPersistListener> persistListeners = new ArrayList<BeanPersistListener>(2);
|
||||
private List<BeanQueryAdapter> queryAdapters = new ArrayList<BeanQueryAdapter>(2);
|
||||
|
||||
private CacheOptions cacheOptions = new CacheOptions();
|
||||
@@ -445,13 +440,13 @@ public class DeployBeanDescriptor<T> {
|
||||
/**
|
||||
* Return the BeanPersistListener (could be a chain of them, 1 or null).
|
||||
*/
|
||||
public BeanPersistListener<T> getPersistListener() {
|
||||
public BeanPersistListener getPersistListener() {
|
||||
if (persistListeners.size() == 0) {
|
||||
return null;
|
||||
} else if (persistListeners.size() == 1) {
|
||||
return persistListeners.get(0);
|
||||
} else {
|
||||
return new ChainedBeanPersistListener<T>(persistListeners);
|
||||
return new ChainedBeanPersistListener(persistListeners);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +467,7 @@ public class DeployBeanDescriptor<T> {
|
||||
persistControllers.add(controller);
|
||||
}
|
||||
|
||||
public void addPersistListener(BeanPersistListener<T> listener) {
|
||||
public void addPersistListener(BeanPersistListener listener) {
|
||||
persistListeners.add(listener);
|
||||
}
|
||||
|
||||
@@ -542,29 +537,6 @@ public class DeployBeanDescriptor<T> {
|
||||
return propMap.get(propName);
|
||||
}
|
||||
|
||||
public Map<String, String> getExtraAttributeMap() {
|
||||
return extraAttrMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a named extra attribute.
|
||||
*/
|
||||
public String getExtraAttribute(String key) {
|
||||
return (String) extraAttrMap.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an extra attribute with a given name.
|
||||
*
|
||||
* @param key
|
||||
* the name of the extra attribute
|
||||
* @param value
|
||||
* the value of the extra attribute
|
||||
*/
|
||||
public void setExtraAttribute(String key, String value) {
|
||||
extraAttrMap.put(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the bean class name this descriptor is used for.
|
||||
* <p>
|
||||
|
||||
Reference in new issue
Block a user