mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #854 from 0xbaadf00d/feature/explicit-type-to-diamond
Replace explicit type with <>
This commit is contained in:
@@ -30,7 +30,7 @@ final class DRawSqlColumnsParser {
|
||||
|
||||
private ColumnMapping parse() {
|
||||
|
||||
ArrayList<ColumnMapping.Column> columns = new ArrayList<ColumnMapping.Column>();
|
||||
ArrayList<ColumnMapping.Column> columns = new ArrayList<>();
|
||||
while (pos <= end) {
|
||||
ColumnMapping.Column c = nextColumnInfo();
|
||||
columns.add(c);
|
||||
@@ -47,7 +47,7 @@ final class DRawSqlColumnsParser {
|
||||
|
||||
String[] split = colInfo.split("\\s(?=[^\\)]*(?:\\(|$))");
|
||||
if (split.length > 1) {
|
||||
ArrayList<String> tmp = new ArrayList<String>(split.length);
|
||||
ArrayList<String> tmp = new ArrayList<>(split.length);
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (!split[i].trim().isEmpty()) {
|
||||
tmp.add(split[i].trim());
|
||||
|
||||
@@ -132,13 +132,13 @@ public final class Ebean {
|
||||
/**
|
||||
* Cache for fast concurrent read access.
|
||||
*/
|
||||
private final ConcurrentHashMap<String, EbeanServer> concMap = new ConcurrentHashMap<String, EbeanServer>();
|
||||
private final ConcurrentHashMap<String, EbeanServer> concMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Cache for synchronized read, creation and put. Protected by the monitor
|
||||
* object.
|
||||
*/
|
||||
private final HashMap<String, EbeanServer> syncMap = new HashMap<String, EbeanServer>();
|
||||
private final HashMap<String, EbeanServer> syncMap = new HashMap<>();
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ public abstract class Model {
|
||||
* Create and return a new Finder for a different server.
|
||||
*/
|
||||
public Finder<I, T> on(String server) {
|
||||
return new Finder<I, T>(server, type);
|
||||
return new Finder<>(server, type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ public final class OrderBy<T> implements Serializable {
|
||||
* Create an empty OrderBy with no associated query.
|
||||
*/
|
||||
public OrderBy() {
|
||||
this.list = new ArrayList<Property>(3);
|
||||
this.list = new ArrayList<>(3);
|
||||
}
|
||||
|
||||
private OrderBy(List<Property> list) {
|
||||
@@ -52,7 +52,7 @@ public final class OrderBy<T> implements Serializable {
|
||||
*/
|
||||
public OrderBy(Query<T> query, String orderByClause) {
|
||||
this.query = query;
|
||||
this.list = new ArrayList<Property>(3);
|
||||
this.list = new ArrayList<>(3);
|
||||
parse(orderByClause);
|
||||
}
|
||||
|
||||
@@ -100,11 +100,11 @@ public final class OrderBy<T> implements Serializable {
|
||||
* Return a copy of this OrderBy with the path trimmed.
|
||||
*/
|
||||
public OrderBy<T> copyWithTrim(String path) {
|
||||
List<Property> newList = new ArrayList<Property>(list.size());
|
||||
List<Property> newList = new ArrayList<>(list.size());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
newList.add(list.get(i).copyWithTrim(path));
|
||||
}
|
||||
return new OrderBy<T>(newList);
|
||||
return new OrderBy<>(newList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +141,7 @@ public final class OrderBy<T> implements Serializable {
|
||||
*/
|
||||
public OrderBy<T> copy() {
|
||||
|
||||
OrderBy<T> copy = new OrderBy<T>();
|
||||
OrderBy<T> copy = new OrderBy<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
copy.add(list.get(i).copy());
|
||||
}
|
||||
@@ -370,7 +370,7 @@ public final class OrderBy<T> implements Serializable {
|
||||
return null;
|
||||
}
|
||||
|
||||
ArrayList<String> wordList = new ArrayList<String>(pairs.length);
|
||||
ArrayList<String> wordList = new ArrayList<>(pairs.length);
|
||||
for (int i = 0; i < pairs.length; i++) {
|
||||
if (!isEmptyString(pairs[i])) {
|
||||
wordList.add(pairs[i]);
|
||||
|
||||
@@ -401,7 +401,7 @@ public final class RawSql implements Serializable {
|
||||
this.parsed = true;
|
||||
this.propertyMap = null;
|
||||
this.propertyColumnMap = null;
|
||||
this.dbColumnMap = new LinkedHashMap<String, Column>();
|
||||
this.dbColumnMap = new LinkedHashMap<>();
|
||||
for (int i = 0; i < columns.size(); i++) {
|
||||
Column c = columns.get(i);
|
||||
dbColumnMap.put(c.getDbColumnKey(), c);
|
||||
@@ -416,7 +416,7 @@ public final class RawSql implements Serializable {
|
||||
this.parsed = false;
|
||||
this.propertyMap = null;
|
||||
this.propertyColumnMap = null;
|
||||
this.dbColumnMap = new LinkedHashMap<String, Column>();
|
||||
this.dbColumnMap = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -426,7 +426,7 @@ public final class RawSql implements Serializable {
|
||||
this.immutable = false;
|
||||
this.parsed = false;
|
||||
this.propertyMap = null;
|
||||
this.dbColumnMap = new LinkedHashMap<String, Column>();
|
||||
this.dbColumnMap = new LinkedHashMap<>();
|
||||
|
||||
int pos = 0;
|
||||
for (String prop : propertyNames) {
|
||||
@@ -443,8 +443,8 @@ public final class RawSql implements Serializable {
|
||||
this.parsed = parsed;
|
||||
this.dbColumnMap = dbColumnMap;
|
||||
|
||||
HashMap<String, Column> pcMap = new HashMap<String, Column>();
|
||||
HashMap<String, String> pMap = new HashMap<String, String>();
|
||||
HashMap<String, Column> pcMap = new HashMap<>();
|
||||
HashMap<String, String> pMap = new HashMap<>();
|
||||
|
||||
for (Column c : dbColumnMap.values()) {
|
||||
pMap.put(c.getPropertyName(), c.getDbColumn());
|
||||
|
||||
@@ -282,7 +282,7 @@ public final class TxScope {
|
||||
*/
|
||||
public TxScope setRollbackFor(Class<? extends Throwable> rollbackThrowable) {
|
||||
if (rollbackFor == null) {
|
||||
rollbackFor = new ArrayList<Class<? extends Throwable>>(2);
|
||||
rollbackFor = new ArrayList<>(2);
|
||||
}
|
||||
rollbackFor.add(rollbackThrowable);
|
||||
return this;
|
||||
@@ -294,7 +294,7 @@ public final class TxScope {
|
||||
@SuppressWarnings("unchecked")
|
||||
public TxScope setRollbackFor(Class<?>[] rollbackThrowables) {
|
||||
if (rollbackFor == null) {
|
||||
rollbackFor = new ArrayList<Class<? extends Throwable>>(rollbackThrowables.length);
|
||||
rollbackFor = new ArrayList<>(rollbackThrowables.length);
|
||||
}
|
||||
for (int i = 0; i < rollbackThrowables.length; i++) {
|
||||
rollbackFor.add((Class<? extends Throwable>) rollbackThrowables[i]);
|
||||
@@ -316,7 +316,7 @@ public final class TxScope {
|
||||
*/
|
||||
public TxScope setNoRollbackFor(Class<? extends Throwable> noRollback) {
|
||||
if (noRollbackFor == null) {
|
||||
noRollbackFor = new ArrayList<Class<? extends Throwable>>(2);
|
||||
noRollbackFor = new ArrayList<>(2);
|
||||
}
|
||||
this.noRollbackFor.add(noRollback);
|
||||
return this;
|
||||
@@ -328,7 +328,7 @@ public final class TxScope {
|
||||
@SuppressWarnings("unchecked")
|
||||
public TxScope setNoRollbackFor(Class<?>[] noRollbacks) {
|
||||
if (noRollbackFor == null) {
|
||||
noRollbackFor = new ArrayList<Class<? extends Throwable>>(noRollbacks.length);
|
||||
noRollbackFor = new ArrayList<>(noRollbacks.length);
|
||||
}
|
||||
for (int i = 0; i < noRollbacks.length; i++) {
|
||||
noRollbackFor.add((Class<? extends Throwable>) noRollbacks[i]);
|
||||
|
||||
@@ -587,7 +587,7 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
if (fullyLoadedBean) {
|
||||
return null;
|
||||
}
|
||||
Set<String> props = new LinkedHashSet<String>();
|
||||
Set<String> props = new LinkedHashSet<>();
|
||||
for (int i=0; i<loadedProps.length; i++) {
|
||||
if (loadedProps[i]) {
|
||||
props.add(getProperty(i));
|
||||
@@ -617,7 +617,7 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
* Return the set of dirty properties.
|
||||
*/
|
||||
public Set<String> getDirtyPropertyNames() {
|
||||
Set<String> props = new LinkedHashSet<String>();
|
||||
Set<String> props = new LinkedHashSet<>();
|
||||
addDirtyPropertyNames(props, null);
|
||||
return props;
|
||||
}
|
||||
@@ -666,7 +666,7 @@ public final class EntityBeanIntercept implements Serializable {
|
||||
* Return a map of dirty properties with their new and old values.
|
||||
*/
|
||||
public Map<String,ValuePair> getDirtyValues() {
|
||||
Map<String,ValuePair> dirtyValues = new LinkedHashMap<String, ValuePair>();
|
||||
Map<String,ValuePair> dirtyValues = new LinkedHashMap<>();
|
||||
addDirtyPropertyValues(dirtyValues, null);
|
||||
return dirtyValues;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class NodeUsageCollector {
|
||||
/**
|
||||
* The properties used at this profile point.
|
||||
*/
|
||||
private final Set<String> used = new LinkedHashSet<String>();
|
||||
private final Set<String> used = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* set to true if the bean is modified (setter called)
|
||||
|
||||
@@ -159,7 +159,7 @@ public abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
|
||||
protected ModifyHolder<E> getModifyHolder() {
|
||||
if (modifyHolder == null) {
|
||||
modifyHolder = new ModifyHolder<E>();
|
||||
modifyHolder = new ModifyHolder<>();
|
||||
}
|
||||
return modifyHolder;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
* Uses an ArrayList as the underlying List implementation.
|
||||
*/
|
||||
public BeanList() {
|
||||
this(new ArrayList<E>());
|
||||
this(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
@SuppressWarnings("unchecked")
|
||||
public void loadFrom(BeanCollection<?> other) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<E>();
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
list.addAll((Collection<? extends E>) other.getActualDetails());
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
@SuppressWarnings("unchecked")
|
||||
public void internalAdd(Object bean) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<E>();
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
if (bean != null) {
|
||||
list.add((E) bean);
|
||||
@@ -92,7 +92,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
|
||||
public boolean checkEmptyLazyLoad() {
|
||||
if (list == null) {
|
||||
list = new ArrayList<E>();
|
||||
list = new ArrayList<>();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -105,7 +105,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
if (!disableLazyLoad && modifyListening) {
|
||||
lazyLoadCollection(true);
|
||||
} else {
|
||||
list = new ArrayList<E>();
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
synchronized (this) {
|
||||
if (list == null) {
|
||||
if (disableLazyLoad) {
|
||||
list = new ArrayList<E>();
|
||||
list = new ArrayList<>();
|
||||
} else {
|
||||
lazyLoadCollection(false);
|
||||
}
|
||||
@@ -296,11 +296,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
public Iterator<E> iterator() {
|
||||
init();
|
||||
if (isReadOnly()) {
|
||||
return new ReadOnlyListIterator<E>(list.listIterator());
|
||||
return new ReadOnlyListIterator<>(list.listIterator());
|
||||
}
|
||||
if (modifyListening) {
|
||||
Iterator<E> it = list.iterator();
|
||||
return new ModifyIterator<E>(this, it);
|
||||
return new ModifyIterator<>(this, it);
|
||||
}
|
||||
return list.iterator();
|
||||
}
|
||||
@@ -313,11 +313,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
public ListIterator<E> listIterator() {
|
||||
init();
|
||||
if (isReadOnly()) {
|
||||
return new ReadOnlyListIterator<E>(list.listIterator());
|
||||
return new ReadOnlyListIterator<>(list.listIterator());
|
||||
}
|
||||
if (modifyListening) {
|
||||
ListIterator<E> it = list.listIterator();
|
||||
return new ModifyListIterator<E>(this, it);
|
||||
return new ModifyListIterator<>(this, it);
|
||||
}
|
||||
return list.listIterator();
|
||||
}
|
||||
@@ -325,11 +325,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
public ListIterator<E> listIterator(int index) {
|
||||
init();
|
||||
if (isReadOnly()) {
|
||||
return new ReadOnlyListIterator<E>(list.listIterator(index));
|
||||
return new ReadOnlyListIterator<>(list.listIterator(index));
|
||||
}
|
||||
if (modifyListening) {
|
||||
ListIterator<E> it = list.listIterator(index);
|
||||
return new ModifyListIterator<E>(this, it);
|
||||
return new ModifyListIterator<>(this, it);
|
||||
}
|
||||
return list.listIterator(index);
|
||||
}
|
||||
@@ -425,7 +425,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
return Collections.unmodifiableList(list.subList(fromIndex, toIndex));
|
||||
}
|
||||
if (modifyListening) {
|
||||
return new ModifyList<E>(this, list.subList(fromIndex, toIndex));
|
||||
return new ModifyList<>(this, list.subList(fromIndex, toIndex));
|
||||
}
|
||||
return list.subList(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
* Create using a underlying LinkedHashMap.
|
||||
*/
|
||||
public BeanMap() {
|
||||
this(new LinkedHashMap<K, E>());
|
||||
this(new LinkedHashMap<>());
|
||||
}
|
||||
|
||||
public BeanMap(BeanCollectionLoader ebeanServer, EntityBean ownerBean, String propertyName) {
|
||||
@@ -61,14 +61,14 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
|
||||
public void internalPutNull() {
|
||||
if (map == null) {
|
||||
map = new LinkedHashMap<K, E>();
|
||||
map = new LinkedHashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void internalPut(Object key, Object bean) {
|
||||
if (map == null) {
|
||||
map = new LinkedHashMap<K, E>();
|
||||
map = new LinkedHashMap<>();
|
||||
}
|
||||
if (key != null) {
|
||||
map.put((K) key, (E) bean);
|
||||
@@ -108,7 +108,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
|
||||
public boolean checkEmptyLazyLoad() {
|
||||
if (map == null) {
|
||||
map = new LinkedHashMap<K, E>();
|
||||
map = new LinkedHashMap<>();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -121,7 +121,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
if (modifyListening) {
|
||||
lazyLoadCollection(true);
|
||||
} else {
|
||||
map = new LinkedHashMap<K, E>();
|
||||
map = new LinkedHashMap<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
}
|
||||
if (modifyListening) {
|
||||
Collection<E> c = map.values();
|
||||
return new ModifyCollection<E>(this, c);
|
||||
return new ModifyCollection<>(this, c);
|
||||
}
|
||||
return map.values();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
* Create using an underlying LinkedHashSet.
|
||||
*/
|
||||
public BeanSet() {
|
||||
this(new LinkedHashSet<E>());
|
||||
this(new LinkedHashSet<>());
|
||||
}
|
||||
|
||||
public BeanSet(BeanCollectionLoader loader, EntityBean ownerBean, String propertyName) {
|
||||
@@ -61,7 +61,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
@SuppressWarnings("unchecked")
|
||||
public void loadFrom(BeanCollection<?> other) {
|
||||
if (set == null) {
|
||||
set = new LinkedHashSet<E>();
|
||||
set = new LinkedHashSet<>();
|
||||
}
|
||||
set.addAll((Collection<? extends E>) other.getActualDetails());
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
@SuppressWarnings("unchecked")
|
||||
public void internalAdd(Object bean) {
|
||||
if (set == null) {
|
||||
set = new LinkedHashSet<E>();
|
||||
set = new LinkedHashSet<>();
|
||||
}
|
||||
if (bean != null) {
|
||||
set.add((E) bean);
|
||||
@@ -100,7 +100,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
|
||||
public boolean checkEmptyLazyLoad() {
|
||||
if (set == null) {
|
||||
set = new LinkedHashSet<E>();
|
||||
set = new LinkedHashSet<>();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -113,7 +113,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
if (modifyListening) {
|
||||
lazyLoadCollection(true);
|
||||
} else {
|
||||
set = new LinkedHashSet<E>();
|
||||
set = new LinkedHashSet<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,10 +256,10 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
public Iterator<E> iterator() {
|
||||
init();
|
||||
if (isReadOnly()) {
|
||||
return new ReadOnlyIterator<E>(set.iterator());
|
||||
return new ReadOnlyIterator<>(set.iterator());
|
||||
}
|
||||
if (modifyListening) {
|
||||
return new ModifyIterator<E>(this, set.iterator());
|
||||
return new ModifyIterator<>(this, set.iterator());
|
||||
}
|
||||
return set.iterator();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class ModifyCollection<E> implements Collection<E> {
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
Iterator<E> it = c.iterator();
|
||||
return new ModifyIterator<E>(owner, it);
|
||||
return new ModifyIterator<>(owner, it);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,16 +21,16 @@ class ModifyHolder<E> implements Serializable {
|
||||
/**
|
||||
* Deletions list for manyToMany persistence.
|
||||
*/
|
||||
private Set<E> modifyDeletions = new LinkedHashSet<E>();
|
||||
private Set<E> modifyDeletions = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* Additions list for manyToMany persistence.
|
||||
*/
|
||||
private Set<E> modifyAdditions = new LinkedHashSet<E>();
|
||||
private Set<E> modifyAdditions = new LinkedHashSet<>();
|
||||
|
||||
void reset() {
|
||||
modifyDeletions = new LinkedHashSet<E>();
|
||||
modifyAdditions = new LinkedHashSet<E>();
|
||||
modifyDeletions = new LinkedHashSet<>();
|
||||
modifyAdditions = new LinkedHashSet<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,11 +61,11 @@ class ModifyList<E> extends ModifyCollection<E> implements List<E> {
|
||||
}
|
||||
|
||||
public ListIterator<E> listIterator() {
|
||||
return new ModifyListIterator<E>(owner, list.listIterator());
|
||||
return new ModifyListIterator<>(owner, list.listIterator());
|
||||
}
|
||||
|
||||
public ListIterator<E> listIterator(int index) {
|
||||
return new ModifyListIterator<E>(owner, list.listIterator(index));
|
||||
return new ModifyListIterator<>(owner, list.listIterator(index));
|
||||
}
|
||||
|
||||
public E remove(int index) {
|
||||
@@ -82,7 +82,7 @@ class ModifyList<E> extends ModifyCollection<E> implements List<E> {
|
||||
}
|
||||
|
||||
public List<E> subList(int fromIndex, int toIndex) {
|
||||
return new ModifyList<E>(owner, list.subList(fromIndex, toIndex));
|
||||
return new ModifyList<>(owner, list.subList(fromIndex, toIndex));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public final class PropertyMap implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
|
||||
private final LinkedHashMap<String, String> map = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Return properties loaded from test-ebean.properties.
|
||||
|
||||
@@ -81,11 +81,11 @@ public class ServerConfig {
|
||||
* Typically configuration type objects that are passed by this ServerConfig
|
||||
* to plugins. For example - IgniteConfiguration passed to Ignite plugin.
|
||||
*/
|
||||
private Map<String, Object> serviceObject = new HashMap<String, Object>();
|
||||
private Map<String, Object> serviceObject = new HashMap<>();
|
||||
|
||||
private ContainerConfig containerConfig;
|
||||
|
||||
private List<CustomDbTypeMapping> customDbTypeMappings = new ArrayList<CustomDbTypeMapping>();
|
||||
private List<CustomDbTypeMapping> customDbTypeMappings = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* The underlying properties that were used during configuration.
|
||||
@@ -121,13 +121,13 @@ public class ServerConfig {
|
||||
* List of interesting classes such as entities, embedded, ScalarTypes,
|
||||
* Listeners, Finders, Controllers etc.
|
||||
*/
|
||||
private List<Class<?>> classes = new ArrayList<Class<?>>();
|
||||
private List<Class<?>> classes = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* The packages that are searched for interesting classes. Only used when
|
||||
* classes is empty/not explicitly specified.
|
||||
*/
|
||||
private List<String> packages = new ArrayList<String>();
|
||||
private List<String> packages = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Configuration for the ElasticSearch integration.
|
||||
@@ -331,15 +331,15 @@ public class ServerConfig {
|
||||
private DbUuid dbUuid = DbUuid.AUTO_VARCHAR;
|
||||
|
||||
|
||||
private List<IdGenerator> idGenerators = new ArrayList<IdGenerator>();
|
||||
private List<BeanFindController> findControllers = new ArrayList<BeanFindController>();
|
||||
private List<BeanPersistController> persistControllers = new ArrayList<BeanPersistController>();
|
||||
private List<BeanPostLoad> postLoaders = new ArrayList<BeanPostLoad>();
|
||||
private List<BeanPostConstructListener> postConstructListeners = new ArrayList<BeanPostConstructListener>();
|
||||
private List<BeanPersistListener> persistListeners = new ArrayList<BeanPersistListener>();
|
||||
private List<BeanQueryAdapter> queryAdapters = new ArrayList<BeanQueryAdapter>();
|
||||
private List<BulkTableEventListener> bulkTableEventListeners = new ArrayList<BulkTableEventListener>();
|
||||
private List<ServerConfigStartup> configStartupListeners = new ArrayList<ServerConfigStartup>();
|
||||
private List<IdGenerator> idGenerators = new ArrayList<>();
|
||||
private List<BeanFindController> findControllers = new ArrayList<>();
|
||||
private List<BeanPersistController> persistControllers = new ArrayList<>();
|
||||
private List<BeanPostLoad> postLoaders = new ArrayList<>();
|
||||
private List<BeanPostConstructListener> postConstructListeners = new ArrayList<>();
|
||||
private List<BeanPersistListener> persistListeners = new ArrayList<>();
|
||||
private List<BeanQueryAdapter> queryAdapters = new ArrayList<>();
|
||||
private List<BulkTableEventListener> bulkTableEventListeners = new ArrayList<>();
|
||||
private List<ServerConfigStartup> configStartupListeners = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* By default inserts are included in the change log.
|
||||
@@ -1726,7 +1726,7 @@ public class ServerConfig {
|
||||
*/
|
||||
public void addClass(Class<?> cls) {
|
||||
if (classes == null) {
|
||||
classes = new ArrayList<Class<?>>();
|
||||
classes = new ArrayList<>();
|
||||
}
|
||||
classes.add(cls);
|
||||
}
|
||||
@@ -1739,7 +1739,7 @@ public class ServerConfig {
|
||||
*/
|
||||
public void addPackage(String packageName) {
|
||||
if (packages == null) {
|
||||
packages = new ArrayList<String>();
|
||||
packages = new ArrayList<>();
|
||||
}
|
||||
packages.add(packageName);
|
||||
}
|
||||
@@ -2488,7 +2488,7 @@ public class ServerConfig {
|
||||
return classes;
|
||||
}
|
||||
|
||||
List<Class<?>> classes = new ArrayList<Class<?>>();
|
||||
List<Class<?>> classes = new ArrayList<>();
|
||||
|
||||
String[] split = classNames.split("[ ,;]");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
@@ -2507,7 +2507,7 @@ public class ServerConfig {
|
||||
|
||||
private List<String> getSearchJarsPackages(String searchPackages) {
|
||||
|
||||
List<String> hitList = new ArrayList<String>();
|
||||
List<String> hitList = new ArrayList<>();
|
||||
|
||||
if (searchPackages != null) {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DbDefaultValue {
|
||||
*/
|
||||
public static final String NOW = "now";
|
||||
|
||||
protected Map<String,String> map = new LinkedHashMap<String,String>();
|
||||
protected Map<String,String> map = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Set the DB now function.
|
||||
|
||||
@@ -11,12 +11,12 @@ class DbPlatformTypeLookup {
|
||||
/**
|
||||
* A map to lookup the type by name.
|
||||
*/
|
||||
private Map<String, DbType> nameLookup = new HashMap<String, DbType>();
|
||||
private Map<String, DbType> nameLookup = new HashMap<>();
|
||||
|
||||
/**
|
||||
* A map to lookup the type by JDBC int value.
|
||||
*/
|
||||
private Map<Integer, DbType> idLookup = new HashMap<Integer, DbType>();
|
||||
private Map<Integer, DbType> idLookup = new HashMap<>();
|
||||
|
||||
DbPlatformTypeLookup() {
|
||||
addAll();
|
||||
|
||||
@@ -25,7 +25,7 @@ public class DbPlatformTypeMapping {
|
||||
private static final DbPlatformType MULTILINESTRING = new DbPlatformType("multilinestring");
|
||||
private static final DbPlatformType MULTIPOLYGON = new DbPlatformType("multipolygon");
|
||||
|
||||
private final Map<DbType, DbPlatformType> typeMap = new HashMap<DbType, DbPlatformType>();
|
||||
private final Map<DbType, DbPlatformType> typeMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Return the DbTypeMap with standard (not platform specific) types.
|
||||
|
||||
@@ -40,7 +40,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
|
||||
protected final BackgroundExecutor backgroundExecutor;
|
||||
|
||||
protected final ArrayList<Long> idList = new ArrayList<Long>(50);
|
||||
protected final ArrayList<Long> idList = new ArrayList<>(50);
|
||||
|
||||
protected final int batchSize;
|
||||
|
||||
@@ -178,7 +178,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
|
||||
String sql = getSql(loadSize);
|
||||
|
||||
ArrayList<Long> newIds = new ArrayList<Long>(loadSize);
|
||||
ArrayList<Long> newIds = new ArrayList<>(loadSize);
|
||||
|
||||
boolean useTxnConnection = t != null;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class DbMigration {
|
||||
|
||||
protected DatabasePlatform databasePlatform;
|
||||
|
||||
protected List<Pair> platforms = new ArrayList<Pair>();
|
||||
protected List<Pair> platforms = new ArrayList<>();
|
||||
|
||||
protected ServerConfig serverConfig;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BaseTableDdl implements TableDdl {
|
||||
/**
|
||||
* Used when unique constraints specifically for OneToOne can't be created normally (MsSqlServer).
|
||||
*/
|
||||
protected List<Column> externalUnique = new ArrayList<Column>();
|
||||
protected List<Column> externalUnique = new ArrayList<>();
|
||||
|
||||
// counters used when constraint names are truncated due to maximum length
|
||||
// and these counters are used to keep the constraint name unique
|
||||
@@ -66,7 +66,7 @@ public class BaseTableDdl implements TableDdl {
|
||||
* Base tables that have associated history tables that need their triggers/functions regenerated as
|
||||
* columns have been added, removed, included or excluded.
|
||||
*/
|
||||
protected Map<String, HistoryTableUpdate> regenerateHistoryTriggers = new LinkedHashMap<String, HistoryTableUpdate>();
|
||||
protected Map<String, HistoryTableUpdate> regenerateHistoryTriggers = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Construct with a naming convention and platform specific DDL.
|
||||
@@ -499,7 +499,7 @@ public class BaseTableDdl implements TableDdl {
|
||||
* Return the list of columns that make the primary key.
|
||||
*/
|
||||
protected List<Column> determinePrimaryKeyColumns(List<Column> columns) {
|
||||
List<Column> pk = new ArrayList<Column>(3);
|
||||
List<Column> pk = new ArrayList<>(3);
|
||||
for (Column column : columns) {
|
||||
if (isTrue(column.isPrimaryKey())) {
|
||||
pk.add(column);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class HistoryTableUpdate {
|
||||
|
||||
private final String baseTable;
|
||||
|
||||
private final List<Column> columnChanges = new ArrayList<Column>();
|
||||
private final List<Column> columnChanges = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct with a given base table name.
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
*/
|
||||
public class IndexColumns {
|
||||
|
||||
List<String> columns = new ArrayList<String>(4);
|
||||
List<String> columns = new ArrayList<>(4);
|
||||
|
||||
/**
|
||||
* Construct representing as a single column index.
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
*/
|
||||
public class IndexSet {
|
||||
|
||||
private List<IndexColumns> indexes = new ArrayList<IndexColumns>();
|
||||
private List<IndexColumns> indexes = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Clear the indexes (for each table).
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AddColumn {
|
||||
*/
|
||||
public List<Column> getColumn() {
|
||||
if (column == null) {
|
||||
column = new ArrayList<Column>();
|
||||
column = new ArrayList<>();
|
||||
}
|
||||
return this.column;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class Applications {
|
||||
*/
|
||||
public List<Application> getApplication() {
|
||||
if (application == null) {
|
||||
application = new ArrayList<Application>();
|
||||
application = new ArrayList<>();
|
||||
}
|
||||
return this.application;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ChangeSet {
|
||||
*/
|
||||
public List<Object> getChangeSetChildren() {
|
||||
if (changeSetChildren == null) {
|
||||
changeSetChildren = new ArrayList<Object>();
|
||||
changeSetChildren = new ArrayList<>();
|
||||
}
|
||||
return this.changeSetChildren;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class CreateTable {
|
||||
*/
|
||||
public List<Column> getColumn() {
|
||||
if (column == null) {
|
||||
column = new ArrayList<Column>();
|
||||
column = new ArrayList<>();
|
||||
}
|
||||
return this.column;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class CreateTable {
|
||||
*/
|
||||
public List<UniqueConstraint> getUniqueConstraint() {
|
||||
if (uniqueConstraint == null) {
|
||||
uniqueConstraint = new ArrayList<UniqueConstraint>();
|
||||
uniqueConstraint = new ArrayList<>();
|
||||
}
|
||||
return this.uniqueConstraint;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class CreateTable {
|
||||
*/
|
||||
public List<ForeignKey> getForeignKey() {
|
||||
if (foreignKey == null) {
|
||||
foreignKey = new ArrayList<ForeignKey>();
|
||||
foreignKey = new ArrayList<>();
|
||||
}
|
||||
return this.foreignKey;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Migration {
|
||||
*/
|
||||
public List<ChangeSet> getChangeSet() {
|
||||
if (changeSet == null) {
|
||||
changeSet = new ArrayList<ChangeSet>();
|
||||
changeSet = new ArrayList<>();
|
||||
}
|
||||
return this.changeSet;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ public class MCompoundForeignKey {
|
||||
|
||||
private String name;
|
||||
private final String referenceTable;
|
||||
private final List<String> columns = new ArrayList<String>();
|
||||
private final List<String> referenceColumns = new ArrayList<String>();
|
||||
private final List<String> columns = new ArrayList<>();
|
||||
private final List<String> referenceColumns = new ArrayList<>();
|
||||
private String indexName;
|
||||
|
||||
public MCompoundForeignKey(String name, String referenceTable, String indexName) {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class MIndex {
|
||||
|
||||
private String indexName;
|
||||
|
||||
private List<String> columns = new ArrayList<String>();
|
||||
private List<String> columns = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Create a single column non unique index.
|
||||
@@ -120,7 +120,7 @@ public class MIndex {
|
||||
|
||||
private List<String> split(String columns) {
|
||||
|
||||
List<String> colList = new ArrayList<String>();
|
||||
List<String> colList = new ArrayList<>();
|
||||
String[] cols = columns.split(",");
|
||||
for (int i = 0; i <cols.length; i++) {
|
||||
colList.add(cols[i]);
|
||||
|
||||
@@ -99,17 +99,17 @@ public class MTable {
|
||||
/**
|
||||
* The columns on the table.
|
||||
*/
|
||||
private Map<String, MColumn> columns = new LinkedHashMap<String, MColumn>();
|
||||
private Map<String, MColumn> columns = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Compound unique constraints.
|
||||
*/
|
||||
private List<MCompoundUniqueConstraint> uniqueConstraints = new ArrayList<MCompoundUniqueConstraint>();
|
||||
private List<MCompoundUniqueConstraint> uniqueConstraints = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Compound foreign keys.
|
||||
*/
|
||||
private List<MCompoundForeignKey> compoundKeys = new ArrayList<MCompoundForeignKey>();
|
||||
private List<MCompoundForeignKey> compoundKeys = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Column name for the 'When created' column. This can be used for the initial effective start date when adding
|
||||
@@ -122,7 +122,7 @@ public class MTable {
|
||||
*/
|
||||
private AddColumn addColumn;
|
||||
|
||||
private List<String> droppedColumns = new ArrayList<String>();
|
||||
private List<String> droppedColumns = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Create a copy of this table structure as a 'draft' table.
|
||||
@@ -369,7 +369,7 @@ public class MTable {
|
||||
|
||||
public List<String> allHistoryColumns(boolean includeDropped) {
|
||||
|
||||
List<String> columnNames = new ArrayList<String>(columns.size());
|
||||
List<String> columnNames = new ArrayList<>(columns.size());
|
||||
for (MColumn column : columns.values()) {
|
||||
if (column.isIncludeInHistory()) {
|
||||
columnNames.add(column.getName());
|
||||
@@ -444,7 +444,7 @@ public class MTable {
|
||||
* Return the list of columns that make the primary key.
|
||||
*/
|
||||
public List<MColumn> primaryKeyColumns() {
|
||||
List<MColumn> pk = new ArrayList<MColumn>(3);
|
||||
List<MColumn> pk = new ArrayList<>(3);
|
||||
for (MColumn column : allColumns()) {
|
||||
if (column.isPrimaryKey()) {
|
||||
pk.add(column);
|
||||
@@ -590,7 +590,7 @@ public class MTable {
|
||||
* Return true if the foreign key names are not unique.
|
||||
*/
|
||||
private boolean hasDuplicateForeignKeys() {
|
||||
Set<String> fkNames = new HashSet<String>();
|
||||
Set<String> fkNames = new HashSet<>();
|
||||
for (MCompoundForeignKey fk : compoundKeys) {
|
||||
if (!fkNames.add(fk.getName())) {
|
||||
return true;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MigrationModel {
|
||||
}
|
||||
});
|
||||
|
||||
List<MigrationResource> resources = new ArrayList<MigrationResource>();
|
||||
List<MigrationResource> resources = new ArrayList<>();
|
||||
|
||||
for (File xmlFile: xmlFiles) {
|
||||
resources.add(new MigrationResource(xmlFile, createVersion(xmlFile)));
|
||||
|
||||
@@ -28,12 +28,12 @@ public class ModelContainer {
|
||||
/**
|
||||
* All the tables in the model.
|
||||
*/
|
||||
private final Map<String, MTable> tables = new LinkedHashMap<String, MTable>();
|
||||
private final Map<String, MTable> tables = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* All the non unique non foreign key indexes.
|
||||
*/
|
||||
private final Map<String, MIndex> indexes = new LinkedHashMap<String, MIndex>();
|
||||
private final Map<String, MIndex> indexes = new LinkedHashMap<>();
|
||||
|
||||
private final PendingDrops pendingDrops = new PendingDrops();
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ public class ModelDiff {
|
||||
/**
|
||||
* List of 'create' type changes.
|
||||
*/
|
||||
private final List<Object> applyChanges = new ArrayList<Object>();
|
||||
private final List<Object> applyChanges = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* List of 'drop' type changes. Expected to be placed into a separate DDL script.
|
||||
*/
|
||||
private final List<Object> dropChanges = new ArrayList<Object>();
|
||||
private final List<Object> dropChanges = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct with a base model.
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
*/
|
||||
public class PendingDrops {
|
||||
|
||||
private final LinkedHashMap<String, Entry> map = new LinkedHashMap<String, Entry>();
|
||||
private final LinkedHashMap<String, Entry> map = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Add a 'pending drops' changeSet for the given version.
|
||||
@@ -36,7 +36,7 @@ public class PendingDrops {
|
||||
*/
|
||||
public List<String> pendingDrops() {
|
||||
|
||||
List<String> versions = new ArrayList<String>();
|
||||
List<String> versions = new ArrayList<>();
|
||||
for (Entry value : map.values()) {
|
||||
if (value.hasPendingDrops()) {
|
||||
versions.add(value.version.asString());
|
||||
@@ -143,7 +143,7 @@ public class PendingDrops {
|
||||
|
||||
final MigrationVersion version;
|
||||
|
||||
final List<ChangeSet> list = new ArrayList<ChangeSet>();
|
||||
final List<ChangeSet> list = new ArrayList<>();
|
||||
|
||||
Entry(MigrationVersion version) {
|
||||
this.version = version;
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ public class ModelBuildPropertyVisitor extends BaseTablePropertyVisitor {
|
||||
|
||||
ImportedId importedId = p.getImportedId();
|
||||
|
||||
List<MColumn> modelColumns = new ArrayList<MColumn>(columns.length);
|
||||
List<MColumn> modelColumns = new ArrayList<>(columns.length);
|
||||
|
||||
MCompoundForeignKey compoundKey = null;
|
||||
if (columns.length > 1) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ChangeSet {
|
||||
/**
|
||||
* The bean changes.
|
||||
*/
|
||||
List<BeanChange> changes = new ArrayList<BeanChange>();
|
||||
List<BeanChange> changes = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct with a txnId.
|
||||
@@ -182,7 +182,7 @@ public class ChangeSet {
|
||||
*/
|
||||
public Map<String,String> getUserContext() {
|
||||
if (userContext == null) {
|
||||
userContext = new LinkedHashMap<String, String>();
|
||||
userContext = new LinkedHashMap<>();
|
||||
}
|
||||
return userContext;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class ReadEvent {
|
||||
*/
|
||||
public Map<String, String> getUserContext() {
|
||||
if (userContext == null) {
|
||||
userContext = new LinkedHashMap<String, String>();
|
||||
userContext = new LinkedHashMap<>();
|
||||
}
|
||||
return userContext;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PathProperties implements FetchPath {
|
||||
*/
|
||||
public PathProperties() {
|
||||
this.rootProps = new Props(this, null, null);
|
||||
this.pathMap = new LinkedHashMap<String, Props>();
|
||||
this.pathMap = new LinkedHashMap<>();
|
||||
this.pathMap.put(null, rootProps);
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public class PathProperties implements FetchPath {
|
||||
}
|
||||
|
||||
private Props(PathProperties owner, String parentPath, String path) {
|
||||
this(owner, parentPath, path, new LinkedHashSet<String>());
|
||||
this(owner, parentPath, path, new LinkedHashSet<>());
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
|
||||
@@ -286,11 +286,11 @@ class EJsonReader {
|
||||
private String key;
|
||||
|
||||
ObjectContext() {
|
||||
map = new LinkedHashMap<String, Object>();
|
||||
map = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
ObjectContext(ModifyAwareOwner owner) {
|
||||
map = new ModifyAwareMap<String, Object>(owner, new LinkedHashMap<String, Object>());
|
||||
map = new ModifyAwareMap<>(owner, new LinkedHashMap<>());
|
||||
}
|
||||
|
||||
public void popContext(Context temp) {
|
||||
@@ -319,11 +319,11 @@ class EJsonReader {
|
||||
private final List<Object> values;
|
||||
|
||||
ArrayContext() {
|
||||
values = new ArrayList<Object>();
|
||||
values = new ArrayList<>();
|
||||
}
|
||||
|
||||
ArrayContext(ModifyAwareOwner owner) {
|
||||
values = new ModifyAwareList<Object>(owner, new ArrayList<Object>());
|
||||
values = new ModifyAwareList<>(owner, new ArrayList<>());
|
||||
}
|
||||
|
||||
public void popContext(Context temp) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class JsonReadOptions {
|
||||
* Default constructor.
|
||||
*/
|
||||
public JsonReadOptions() {
|
||||
this.visitorMap = new LinkedHashMap<String, JsonReadBeanVisitor<?>>();
|
||||
this.visitorMap = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,7 +85,7 @@ public class JsonWriteOptions {
|
||||
*/
|
||||
public JsonWriteOptions setPathVisitor(String path, JsonWriteBeanVisitor<?> visitor) {
|
||||
if (visitorMap == null) {
|
||||
visitorMap = new HashMap<String, JsonWriteBeanVisitor<?>>();
|
||||
visitorMap = new HashMap<>();
|
||||
}
|
||||
visitorMap.put(path, visitor);
|
||||
return this;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class StringHelper {
|
||||
throw new RuntimeException("missing quoted value at the end of " + tag);
|
||||
}
|
||||
|
||||
HashMap<String, String> map = new HashMap<String, String>();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// recursively parse out the name value pairs...
|
||||
return parseNameQuotedValue(map, tag, 0);
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class StringHelper {
|
||||
public static Map<String, String> delimitedToMap(String allNameValuePairs,
|
||||
String listDelimiter, String nameValueSeparator) {
|
||||
|
||||
HashMap<String, String> params = new HashMap<String, String>();
|
||||
HashMap<String, String> params = new HashMap<>();
|
||||
if ((allNameValuePairs == null) || (allNameValuePairs.isEmpty())) {
|
||||
return params;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public class StringHelper {
|
||||
*/
|
||||
public static String[] delimitedToArray(String str, String delimiter, boolean keepEmpties) {
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
int startPos = 0;
|
||||
delimiter(str, delimiter, keepEmpties, startPos, list);
|
||||
String[] result = new String[list.size()];
|
||||
|
||||
@@ -20,9 +20,9 @@ public class BindParams implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4541081933302086285L;
|
||||
|
||||
private final List<Param> positionedParameters = new ArrayList<Param>();
|
||||
private final List<Param> positionedParameters = new ArrayList<>();
|
||||
|
||||
private final Map<String, Param> namedParameters = new LinkedHashMap<String, Param>();
|
||||
private final Map<String, Param> namedParameters = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* This is the sql. For named parameters this is the sql after the named
|
||||
@@ -308,7 +308,7 @@ public class BindParams implements Serializable {
|
||||
private final StringBuilder preparedSql;
|
||||
|
||||
public OrderedList() {
|
||||
this(new ArrayList<Param>());
|
||||
this(new ArrayList<>());
|
||||
}
|
||||
|
||||
public OrderedList(List<Param> paramList) {
|
||||
|
||||
@@ -95,7 +95,7 @@ public class LoadBeanRequest extends LoadRequest {
|
||||
*/
|
||||
public List<Object> getIdList(int batchSize) {
|
||||
|
||||
List<Object> idList = new ArrayList<Object>(batchSize);
|
||||
List<Object> idList = new ArrayList<>(batchSize);
|
||||
|
||||
BeanDescriptor<?> desc = loadBuffer.getBeanDescriptor();
|
||||
for (int i = 0; i < batch.size(); i++) {
|
||||
@@ -150,7 +150,7 @@ public class LoadBeanRequest extends LoadRequest {
|
||||
*/
|
||||
public void postLoad(List<?> list) {
|
||||
|
||||
Set<Object> loadedIds = new HashSet<Object>();
|
||||
Set<Object> loadedIds = new HashSet<>();
|
||||
|
||||
BeanDescriptor<?> desc = loadBuffer.getBeanDescriptor();
|
||||
// collect Ids and maybe load bean cache
|
||||
|
||||
@@ -101,7 +101,7 @@ public class LoadManyRequest extends LoadRequest {
|
||||
|
||||
private List<Object> getParentIdList(int batchSize) {
|
||||
|
||||
ArrayList<Object> idList = new ArrayList<Object>(batchSize);
|
||||
ArrayList<Object> idList = new ArrayList<>(batchSize);
|
||||
|
||||
BeanPropertyAssocMany<?> many = getMany();
|
||||
for (int i = 0; i < batch.size(); i++) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ManyWhereJoins implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6490181101871795417L;
|
||||
|
||||
private final TreeMap<String, PropertyJoin> joins = new TreeMap<String, PropertyJoin>();
|
||||
private final TreeMap<String, PropertyJoin> joins = new TreeMap<>();
|
||||
|
||||
private StringBuilder formulaProperties = new StringBuilder();
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ManyWhereJoins implements Serializable {
|
||||
*/
|
||||
public TreeSet<String> getPropertyNames() {
|
||||
|
||||
TreeSet<String> propertyNames = new TreeSet<String>();
|
||||
TreeSet<String> propertyNames = new TreeSet<>();
|
||||
for (PropertyJoin join : joins.values()) {
|
||||
propertyNames.add(join.getProperty());
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class SpiExpressionValidation {
|
||||
|
||||
private final BeanType<?> desc;
|
||||
|
||||
private final LinkedHashSet<String> unknown = new LinkedHashSet<String>();
|
||||
private final LinkedHashSet<String> unknown = new LinkedHashSet<>();
|
||||
|
||||
public SpiExpressionValidation(BeanType<?> desc) {
|
||||
this.desc = desc;
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
*/
|
||||
public class TransactionEventBeans {
|
||||
|
||||
final ArrayList<PersistRequestBean<?>> requests = new ArrayList<PersistRequestBean<?>>();
|
||||
final ArrayList<PersistRequestBean<?>> requests = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Return the list of PersistRequests that BeanListeners are interested in.
|
||||
|
||||
@@ -16,7 +16,7 @@ public final class TransactionEventTable implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2236555729767483264L;
|
||||
|
||||
private final Map<String, TableIUD> map = new HashMap<String, TableIUD>();
|
||||
private final Map<String, TableIUD> map = new HashMap<>();
|
||||
|
||||
public String toString() {
|
||||
return "TransactionEventTable " + map.values();
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ExtraDdl {
|
||||
*/
|
||||
public List<DdlScript> getDdlScript() {
|
||||
if (ddlScript == null) {
|
||||
ddlScript = new ArrayList<DdlScript>();
|
||||
ddlScript = new ArrayList<>();
|
||||
}
|
||||
return this.ddlScript;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
*/
|
||||
public class AutoTuneCollection {
|
||||
|
||||
List<Entry> entries = new ArrayList<Entry>();
|
||||
List<Entry> entries = new ArrayList<>();
|
||||
|
||||
public Entry add(ObjectGraphOrigin origin, OrmQueryDetail detail, String sourceQuery) {
|
||||
Entry entry = new Entry(origin, detail, sourceQuery);
|
||||
@@ -46,7 +46,7 @@ public class AutoTuneCollection {
|
||||
/**
|
||||
* Summary execution statistics for queries related to this origin point.
|
||||
*/
|
||||
private final List<EntryQuery> queries = new ArrayList<EntryQuery>();
|
||||
private final List<EntryQuery> queries = new ArrayList<>();
|
||||
|
||||
public Entry(ObjectGraphOrigin origin, OrmQueryDetail detail, String originalQuery) {
|
||||
this.origin = origin;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Autotune {
|
||||
*/
|
||||
public List<Origin> getOrigin() {
|
||||
if (origin == null) {
|
||||
origin = new ArrayList<Origin>();
|
||||
origin = new ArrayList<>();
|
||||
}
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ProfileDiff {
|
||||
*/
|
||||
public List<Origin> getOrigin() {
|
||||
if (origin == null) {
|
||||
origin = new ArrayList<Origin>();
|
||||
origin = new ArrayList<>();
|
||||
}
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ProfileEmpty {
|
||||
*/
|
||||
public List<Origin> getOrigin() {
|
||||
if (origin == null) {
|
||||
origin = new ArrayList<Origin>();
|
||||
origin = new ArrayList<>();
|
||||
}
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ProfileNew {
|
||||
*/
|
||||
public List<Origin> getOrigin() {
|
||||
if (origin == null) {
|
||||
origin = new ArrayList<Origin>();
|
||||
origin = new ArrayList<>();
|
||||
}
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BaseQueryTuner {
|
||||
/**
|
||||
* Map of the tuned query details per profile query point.
|
||||
*/
|
||||
private final Map<String, TunedQueryInfo> tunedQueryInfoMap = new ConcurrentHashMap<String, TunedQueryInfo>();
|
||||
private final Map<String, TunedQueryInfo> tunedQueryInfoMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final SpiEbeanServer server;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ProfileManager implements ProfilingListener {
|
||||
/**
|
||||
* Map of the usage and query statistics gathered.
|
||||
*/
|
||||
private final Map<String, ProfileOrigin> profileMap = new ConcurrentHashMap<String, ProfileOrigin>();
|
||||
private final Map<String, ProfileOrigin> profileMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ public class ProfileOrigin {
|
||||
|
||||
private final double profilingRate;
|
||||
|
||||
private final Map<String, ProfileOriginQuery> queryStatsMap = new ConcurrentHashMap<String, ProfileOriginQuery>();
|
||||
private final Map<String, ProfileOriginQuery> queryStatsMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Map<String, ProfileOriginNodeUsage> nodeUsageMap = new ConcurrentHashMap<String, ProfileOriginNodeUsage>();
|
||||
private final Map<String, ProfileOriginNodeUsage> nodeUsageMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class ProfileOriginNodeUsage {
|
||||
|
||||
private boolean modified;
|
||||
|
||||
private final Set<String> aggregateUsed = new LinkedHashSet<String>();
|
||||
private final Set<String> aggregateUsed = new LinkedHashSet<>();
|
||||
|
||||
public ProfileOriginNodeUsage(String path) {
|
||||
// handle null paths as using ConcurrentHashMap
|
||||
|
||||
@@ -15,16 +15,16 @@ import java.util.Set;
|
||||
*/
|
||||
public class CacheChangeSet {
|
||||
|
||||
private final List<CacheChange> entries = new ArrayList<CacheChange>();
|
||||
private final List<CacheChange> entries = new ArrayList<>();
|
||||
|
||||
private final Set<BeanDescriptor<?>> queryCaches = new HashSet<>();
|
||||
|
||||
private final Map<ManyKey, ManyChange> manyChangeMap = new HashMap<ManyKey, ManyChange>();
|
||||
private final Map<ManyKey, ManyChange> manyChangeMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Set of "base tables" modified used to invalidate entities based on views.
|
||||
*/
|
||||
private final Set<String> viewInvalidation = new HashSet<String>();
|
||||
private final Set<String> viewInvalidation = new HashSet<>();
|
||||
|
||||
private final boolean viewEntityInvalidation;
|
||||
|
||||
@@ -137,9 +137,9 @@ public class CacheChangeSet {
|
||||
|
||||
final ManyKey key;
|
||||
|
||||
final List<Object> removes = new ArrayList<Object>();
|
||||
final List<Object> removes = new ArrayList<>();
|
||||
|
||||
final Map<Object,CachedManyIds> puts = new LinkedHashMap<Object, CachedManyIds>();
|
||||
final Map<Object,CachedManyIds> puts = new LinkedHashMap<>();
|
||||
|
||||
boolean clear;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CachedBeanData implements Externalizable {
|
||||
if (in.readBoolean()) {
|
||||
discValue = in.readUTF();
|
||||
}
|
||||
data = new LinkedHashMap<String, Object>();
|
||||
data = new LinkedHashMap<>();
|
||||
int count = in.readInt();
|
||||
for (int i = 0; i < count; i++) {
|
||||
String key = in.readUTF();
|
||||
@@ -82,7 +82,7 @@ public class CachedBeanData implements Externalizable {
|
||||
*/
|
||||
public CachedBeanData update(Map<String, Object> changes, long version) {
|
||||
|
||||
Map<String, Object> copy = new HashMap<String, Object>();
|
||||
Map<String, Object> copy = new HashMap<>();
|
||||
copy.putAll(data);
|
||||
copy.putAll(changes);
|
||||
return new CachedBeanData(null, discValue, copy, version);
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ public class CachedBeanDataFromBean {
|
||||
|
||||
EntityBeanIntercept ebi = bean._ebean_getIntercept();
|
||||
|
||||
Map<String,Object> data = new LinkedHashMap<String,Object>();
|
||||
Map<String,Object> data = new LinkedHashMap<>();
|
||||
|
||||
BeanProperty idProperty = desc.getIdProperty();
|
||||
if (idProperty != null) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CachedManyIds implements Externalizable {
|
||||
@Override
|
||||
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
|
||||
int size = in.readInt();
|
||||
idList = new ArrayList<Object>(size);
|
||||
idList = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
idList.add(in.readObject());
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public class DefaultCacheHolder {
|
||||
|
||||
private final ConcurrentHashMap<String, ServerCache> concMap = new ConcurrentHashMap<String, ServerCache>();
|
||||
private final ConcurrentHashMap<String, ServerCache> concMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final HashMap<String, ServerCache> synchMap = new HashMap<String, ServerCache>();
|
||||
private final HashMap<String, ServerCache> synchMap = new HashMap<>();
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public class DefaultServerCache implements ServerCache {
|
||||
* Construct using a ConcurrentHashMap and cache options.
|
||||
*/
|
||||
public DefaultServerCache(String name, ServerCacheOptions options) {
|
||||
this(name, new ConcurrentHashMap<Object, CacheEntry>(), options);
|
||||
this(name, new ConcurrentHashMap<>(), options);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,7 +277,7 @@ public class DefaultServerCache implements ServerCache {
|
||||
long trimmedByTTL = 0;
|
||||
long trimmedByLRU = 0;
|
||||
|
||||
ArrayList<CacheEntry> activeList = new ArrayList<CacheEntry>();
|
||||
ArrayList<CacheEntry> activeList = new ArrayList<>();
|
||||
|
||||
long idleExpire = System.currentTimeMillis() - (maxIdleSecs * 1000);
|
||||
long ttlExpire = System.currentTimeMillis() - (maxSecsToLive * 1000);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class DefaultChangeLogRegister implements ChangeLogRegister {
|
||||
return insertModeInclude(changeLog.inserts()) ? INCLUDE_INSERTS : EXCLUDE_INSERTS;
|
||||
}
|
||||
|
||||
Set<String> updateProps = new HashSet<String>();
|
||||
Set<String> updateProps = new HashSet<>();
|
||||
for (int i = 0; i < updatesThatInclude.length; i++) {
|
||||
updateProps.add(updatesThatInclude[i]);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
*/
|
||||
public class BinaryMessageList {
|
||||
|
||||
final ArrayList<BinaryMessage> list = new ArrayList<BinaryMessage>();
|
||||
final ArrayList<BinaryMessage> list = new ArrayList<>();
|
||||
|
||||
public void add(BinaryMessage msg) {
|
||||
list.add(msg);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ClusterManager {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClusterManager.class);
|
||||
|
||||
private final ConcurrentHashMap<String, EbeanServer> serverMap = new ConcurrentHashMap<String, EbeanServer>();
|
||||
private final ConcurrentHashMap<String, EbeanServer> serverMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ClassPathScanners {
|
||||
*/
|
||||
public static List<ClassPathScanner> find(ServerConfig serverConfig) {
|
||||
|
||||
List<ClassPathScanner> scanners = new ArrayList<ClassPathScanner>();
|
||||
List<ClassPathScanner> scanners = new ArrayList<>();
|
||||
|
||||
ServiceLoader<ClassPathScannerFactory> scannerLoader = serverConfig.serviceLoad(ClassPathScannerFactory.class);
|
||||
for (ClassPathScannerFactory factory : scannerLoader) {
|
||||
|
||||
@@ -27,13 +27,13 @@ public class DefaultMetaInfoManager implements MetaInfoManager {
|
||||
@Override
|
||||
public List<MetaBeanInfo> getMetaBeanInfoList() {
|
||||
|
||||
return new ArrayList<MetaBeanInfo>(server.getBeanDescriptors());
|
||||
return new ArrayList<>(server.getBeanDescriptors());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetaQueryPlanStatistic> collectQueryPlanStatistics(boolean reset) {
|
||||
|
||||
List<MetaQueryPlanStatistic> list = new ArrayList<MetaQueryPlanStatistic>();
|
||||
List<MetaQueryPlanStatistic> list = new ArrayList<>();
|
||||
|
||||
for (MetaBeanInfo metaBeanInfo : getMetaBeanInfoList()) {
|
||||
list.addAll(metaBeanInfo.collectQueryPlanStatistics(reset));
|
||||
@@ -44,7 +44,7 @@ public class DefaultMetaInfoManager implements MetaInfoManager {
|
||||
|
||||
public List<MetaObjectGraphNodeStats> collectNodeStatistics(boolean reset) {
|
||||
|
||||
List<MetaObjectGraphNodeStats> list = new ArrayList<MetaObjectGraphNodeStats>();
|
||||
List<MetaObjectGraphNodeStats> list = new ArrayList<>();
|
||||
|
||||
for (CObjectGraphNodeStatistics nodeStatistics : server.objectGraphStats.values()) {
|
||||
MetaObjectGraphNodeStats nodeStats = nodeStatistics.get(reset);
|
||||
|
||||
@@ -190,7 +190,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
public DefaultServer(InternalConfiguration config, ServerCacheManager cache) {
|
||||
|
||||
this.serverConfig = config.getServerConfig();
|
||||
this.objectGraphStats = new ConcurrentHashMap<ObjectGraphNode, CObjectGraphNodeStatistics>();
|
||||
this.objectGraphStats = new ConcurrentHashMap<>();
|
||||
this.metaInfoManager = new DefaultMetaInfoManager(this);
|
||||
this.serverCacheManager = cache;
|
||||
this.databasePlatform = config.getDatabasePlatform();
|
||||
@@ -871,7 +871,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
String m = beanType.getName() + " is NOT an Entity Bean registered with this server?";
|
||||
throw new PersistenceException(m);
|
||||
}
|
||||
return new ElFilter<T>(desc);
|
||||
return new ElFilter<>(desc);
|
||||
}
|
||||
|
||||
public <T> CsvReader<T> createCsvReader(Class<T> beanType) {
|
||||
@@ -879,11 +879,11 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
if (descriptor == null) {
|
||||
throw new NullPointerException("BeanDescriptor for " + beanType.getName() + " not found");
|
||||
}
|
||||
return new TCsvReader<T>(this, descriptor);
|
||||
return new TCsvReader<>(this, descriptor);
|
||||
}
|
||||
|
||||
public <T> UpdateQuery<T> update(Class<T> beanType) {
|
||||
return new DefaultUpdateQuery<T>(createQuery(beanType));
|
||||
return new DefaultUpdateQuery<>(createQuery(beanType));
|
||||
}
|
||||
|
||||
public <T> Query<T> find(Class<T> beanType) {
|
||||
@@ -921,7 +921,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
if (desc == null) {
|
||||
throw new PersistenceException(beanType.getName() + " is NOT an Entity Bean registered with this server?");
|
||||
}
|
||||
return new DefaultOrmQuery<T>(desc, this, expressionFactory);
|
||||
return new DefaultOrmQuery<>(desc, this, expressionFactory);
|
||||
}
|
||||
|
||||
public <T> Update<T> createUpdate(Class<T> beanType, String ormUpdate) {
|
||||
@@ -931,7 +931,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
throw new PersistenceException(m);
|
||||
}
|
||||
|
||||
return new DefaultOrmUpdate<T>(beanType, this, desc.getBaseTable(), ormUpdate);
|
||||
return new DefaultOrmUpdate<>(beanType, this, desc.getBaseTable(), ormUpdate);
|
||||
}
|
||||
|
||||
public SqlQuery createSqlQuery(String sql) {
|
||||
@@ -989,7 +989,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
query.setOrigin(createCallStack());
|
||||
}
|
||||
|
||||
OrmQueryRequest<T> request = new OrmQueryRequest<T>(this, queryEngine, query, (SpiTransaction) t);
|
||||
OrmQueryRequest<T> request = new OrmQueryRequest<>(this, queryEngine, query, (SpiTransaction) t);
|
||||
request.prepareQuery();
|
||||
|
||||
return request;
|
||||
@@ -1242,9 +1242,9 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
Transaction newTxn = createTransaction();
|
||||
|
||||
CallableQueryRowCount<T> call = new CallableQueryRowCount<T>(this, copy, newTxn);
|
||||
CallableQueryRowCount<T> call = new CallableQueryRowCount<>(this, copy, newTxn);
|
||||
|
||||
QueryFutureRowCount<T> queryFuture = new QueryFutureRowCount<T>(call);
|
||||
QueryFutureRowCount<T> queryFuture = new QueryFutureRowCount<>(call);
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
|
||||
return queryFuture;
|
||||
@@ -1261,8 +1261,8 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
Transaction newTxn = createTransaction();
|
||||
|
||||
CallableQueryIds<T> call = new CallableQueryIds<T>(this, copy, newTxn);
|
||||
QueryFutureIds<T> queryFuture = new QueryFutureIds<T>(call);
|
||||
CallableQueryIds<T> call = new CallableQueryIds<>(this, copy, newTxn);
|
||||
QueryFutureIds<T> queryFuture = new QueryFutureIds<>(call);
|
||||
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
|
||||
@@ -1284,8 +1284,8 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
// Create a new transaction solely to execute the findList() at some future time
|
||||
Transaction newTxn = createTransaction();
|
||||
CallableQueryList<T> call = new CallableQueryList<T>(this, spiQuery, newTxn);
|
||||
QueryFutureList<T> queryFuture = new QueryFutureList<T>(call);
|
||||
CallableQueryList<T> call = new CallableQueryList<>(this, spiQuery, newTxn);
|
||||
QueryFutureList<T> queryFuture = new QueryFutureList<>(call);
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
return queryFuture;
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return docStore().findPagedList(createQueryRequest(Type.LIST, query, transaction));
|
||||
}
|
||||
|
||||
return new LimitOffsetPagedList<T>(this, spiQuery);
|
||||
return new LimitOffsetPagedList<>(this, spiQuery);
|
||||
}
|
||||
|
||||
public <T> QueryIterator<T> findIterate(Query<T> query, Transaction t) {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DiffHelp {
|
||||
if (!assoc.isEmbedded()) {
|
||||
// flatten for assoc one beans
|
||||
if (flattened == null) {
|
||||
flattened = new LinkedHashMap<String, ValuePair>();
|
||||
flattened = new LinkedHashMap<>();
|
||||
}
|
||||
flattenToId(flattened, entry, beanProperty, assoc);
|
||||
iterator.remove();
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.HashMap;
|
||||
*/
|
||||
public final class InternString {
|
||||
|
||||
private static final HashMap<String,String> map = new HashMap<String,String>();
|
||||
private static final HashMap<String,String> map = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,7 @@ public class InternalConfiguration {
|
||||
/**
|
||||
* List of plugins (that ultimately the DefaultServer configures late in construction).
|
||||
*/
|
||||
private final List<Plugin> plugins = new ArrayList<Plugin>();
|
||||
private final List<Plugin> plugins = new ArrayList<>();
|
||||
|
||||
public InternalConfiguration(ClusterManager clusterManager,
|
||||
ServerCacheManager cacheManager, SpiBackgroundExecutor backgroundExecutor,
|
||||
|
||||
@@ -449,7 +449,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements BeanQueryRe
|
||||
if (cached != null && isAuditReads() && readAuditQueryType()) {
|
||||
// raw sql can't use L2 cache so normal queries only in here
|
||||
Collection<T> actualDetails = cached.getActualDetails();
|
||||
List<Object> ids = new ArrayList<Object>(actualDetails.size());
|
||||
List<Object> ids = new ArrayList<>(actualDetails.size());
|
||||
for (T bean : actualDetails) {
|
||||
ids.add(beanDescriptor.getIdForJson(bean));
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
*/
|
||||
public void addUpdatedManyProperty(BeanPropertyAssocMany<?> updatedAssocMany) {
|
||||
if (updatedManys == null) {
|
||||
updatedManys = new ArrayList<BeanPropertyAssocMany<?>>(5);
|
||||
updatedManys = new ArrayList<>(5);
|
||||
}
|
||||
updatedManys.add(updatedAssocMany);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public final class RelationalQueryRequest {
|
||||
*/
|
||||
private String[] getPropertyNames() throws SQLException {
|
||||
|
||||
ArrayList<String> propNames = new ArrayList<String>();
|
||||
ArrayList<String> propNames = new ArrayList<>();
|
||||
ResultSetMetaData metaData = resultSet.getMetaData();
|
||||
|
||||
int columnsPlusOne = metaData.getColumnCount() + 1;
|
||||
|
||||
@@ -38,45 +38,45 @@ public class BootupClasses implements ClassFilter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BootupClasses.class);
|
||||
|
||||
private final List<Class<?>> embeddableList = new ArrayList<Class<?>>();
|
||||
private final List<Class<?>> embeddableList = new ArrayList<>();
|
||||
|
||||
private final List<Class<?>> entityList = new ArrayList<Class<?>>();
|
||||
private final List<Class<?>> entityList = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends ScalarType<?>>> scalarTypeList = new ArrayList<Class<? extends ScalarType<?>>>();
|
||||
private final List<Class<? extends ScalarType<?>>> scalarTypeList = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends ScalarTypeConverter<?, ?>>> scalarConverterList = new ArrayList<Class<? extends ScalarTypeConverter<?, ?>>>();
|
||||
private final List<Class<? extends ScalarTypeConverter<?, ?>>> scalarConverterList = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends CompoundType<?>>> compoundTypeList = new ArrayList<Class<? extends CompoundType<?>>>();
|
||||
private final List<Class<? extends CompoundType<?>>> compoundTypeList = new ArrayList<>();
|
||||
|
||||
|
||||
// The following objects are instantiiated on first request
|
||||
// there is always a candidate list, that holds the class and an
|
||||
// instance list, that holds the instance. Once a class is instantiiated
|
||||
// (or added) it will get removed from the candidate list
|
||||
private final List<Class<? extends IdGenerator>> idGeneratorCandidates = new ArrayList<Class<? extends IdGenerator>>();
|
||||
private final List<Class<? extends IdGenerator>> idGeneratorCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanPersistController>> beanPersistControllerCandidates = new ArrayList<Class<? extends BeanPersistController>>();
|
||||
private final List<Class<? extends BeanPersistController>> beanPersistControllerCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanPostLoad>> beanPostLoadCandidates = new ArrayList<Class<? extends BeanPostLoad>>();
|
||||
private final List<Class<? extends BeanPostLoad>> beanPostLoadCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanPostConstructListener>> beanPostConstructListenerCandidates = new ArrayList<Class<? extends BeanPostConstructListener>>();
|
||||
private final List<Class<? extends BeanPostConstructListener>> beanPostConstructListenerCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanFindController>> beanFindControllerCandidates = new ArrayList<Class<? extends BeanFindController>>();
|
||||
private final List<Class<? extends BeanFindController>> beanFindControllerCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanPersistListener>> beanPersistListenerCandidates = new ArrayList<Class<? extends BeanPersistListener>>();
|
||||
private final List<Class<? extends BeanPersistListener>> beanPersistListenerCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends BeanQueryAdapter>> beanQueryAdapterCandidates = new ArrayList<Class<? extends BeanQueryAdapter>>();
|
||||
private final List<Class<? extends BeanQueryAdapter>> beanQueryAdapterCandidates = new ArrayList<>();
|
||||
|
||||
private final List<Class<? extends ServerConfigStartup>> serverConfigStartupCandidates = new ArrayList<Class<? extends ServerConfigStartup>>();
|
||||
private final List<Class<? extends ServerConfigStartup>> serverConfigStartupCandidates = new ArrayList<>();
|
||||
|
||||
private final List<IdGenerator> idGeneratorInstances = new ArrayList<IdGenerator>();
|
||||
private final List<BeanPersistController> beanPersistControllerInstances = new ArrayList<BeanPersistController>();
|
||||
private final List<BeanPostLoad> beanPostLoadInstances = new ArrayList<BeanPostLoad>();
|
||||
private final List<BeanPostConstructListener> beanPostConstructListenerInstances = new ArrayList<BeanPostConstructListener>();
|
||||
private final List<BeanFindController> beanFindControllerInstances = new ArrayList<BeanFindController>();
|
||||
private final List<BeanPersistListener> beanPersistListenerInstances = new ArrayList<BeanPersistListener>();
|
||||
private final List<BeanQueryAdapter> beanQueryAdapterInstances = new ArrayList<BeanQueryAdapter>();
|
||||
private final List<ServerConfigStartup> serverConfigStartupInstances = new ArrayList<ServerConfigStartup>();
|
||||
private final List<IdGenerator> idGeneratorInstances = new ArrayList<>();
|
||||
private final List<BeanPersistController> beanPersistControllerInstances = new ArrayList<>();
|
||||
private final List<BeanPostLoad> beanPostLoadInstances = new ArrayList<>();
|
||||
private final List<BeanPostConstructListener> beanPostConstructListenerInstances = new ArrayList<>();
|
||||
private final List<BeanFindController> beanFindControllerInstances = new ArrayList<>();
|
||||
private final List<BeanPersistListener> beanPersistListenerInstances = new ArrayList<>();
|
||||
private final List<BeanQueryAdapter> beanQueryAdapterInstances = new ArrayList<>();
|
||||
private final List<ServerConfigStartup> serverConfigStartupInstances = new ArrayList<>();
|
||||
|
||||
// single objects
|
||||
private Class<? extends ChangeLogPrepare> changeLogPrepareClass;
|
||||
|
||||
@@ -17,11 +17,11 @@ class DistillPackages {
|
||||
static List<String> distill(Collection<String> packages, Collection<String> mfPackages) {
|
||||
|
||||
// sort into natural order
|
||||
TreeSet<String> treeSet = new TreeSet<String>();
|
||||
TreeSet<String> treeSet = new TreeSet<>();
|
||||
treeSet.addAll(packages);
|
||||
treeSet.addAll(mfPackages);
|
||||
|
||||
List<String> distilled = new ArrayList<String>();
|
||||
List<String> distilled = new ArrayList<>();
|
||||
|
||||
// build the distilled list
|
||||
for (String pack : treeSet) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class ManifestReader {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ManifestReader.class);
|
||||
|
||||
private final Set<String> packageSet = new HashSet<String>();
|
||||
private final Set<String> packageSet = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Read the packages from ebean.mf manifest files found as resources.
|
||||
|
||||
@@ -21,11 +21,11 @@ public class BeanCollectionHelpFactory {
|
||||
ManyType manyType = manyProperty.getManyType();
|
||||
switch (manyType) {
|
||||
case LIST:
|
||||
return new BeanListHelp<T>(manyProperty);
|
||||
return new BeanListHelp<>(manyProperty);
|
||||
case SET:
|
||||
return new BeanSetHelp<T>(manyProperty);
|
||||
return new BeanSetHelp<>(manyProperty);
|
||||
case MAP:
|
||||
return new BeanMapHelp<T>(manyProperty);
|
||||
return new BeanMapHelp<>(manyProperty);
|
||||
default:
|
||||
throw new RuntimeException("Invalid type " + manyType);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class BeanCollectionHelpFactory {
|
||||
} else {
|
||||
BeanDescriptor<T> target = request.getBeanDescriptor();
|
||||
String mapKey = request.getQuery().getMapKey();
|
||||
return new BeanMapHelp<T>(target, mapKey);
|
||||
return new BeanMapHelp<>(target, mapKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,15 +101,15 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanDescriptor.class);
|
||||
|
||||
private final ConcurrentHashMap<Integer, SpiUpdatePlan> updatePlanCache = new ConcurrentHashMap<Integer, SpiUpdatePlan>();
|
||||
private final ConcurrentHashMap<Integer, SpiUpdatePlan> updatePlanCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentHashMap<CQueryPlanKey, CQueryPlan> queryPlanCache = new ConcurrentHashMap<CQueryPlanKey, CQueryPlan>();
|
||||
private final ConcurrentHashMap<CQueryPlanKey, CQueryPlan> queryPlanCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentHashMap<String, ElPropertyValue> elCache = new ConcurrentHashMap<String, ElPropertyValue>();
|
||||
private final ConcurrentHashMap<String, ElPropertyValue> elCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentHashMap<String, ElPropertyDeploy> elDeployCache = new ConcurrentHashMap<String, ElPropertyDeploy>();
|
||||
private final ConcurrentHashMap<String, ElPropertyDeploy> elDeployCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final ConcurrentHashMap<String, ElComparator<T>> comparatorCache = new ConcurrentHashMap<String, ElComparator<T>>();
|
||||
private final ConcurrentHashMap<String, ElComparator<T>> comparatorCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final Map<String, RawSql> namedRawSql;
|
||||
|
||||
@@ -492,9 +492,9 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
boolean noRelationships = propertiesOne.length + propertiesMany.length == 0;
|
||||
|
||||
this.cacheSharableBeans = noRelationships && deploy.getCacheOptions().isReadOnly();
|
||||
this.cacheHelp = new BeanDescriptorCacheHelp<T>(this, owner.getCacheManager(), deploy.getCacheOptions(), cacheSharableBeans, propertiesOneImported);
|
||||
this.jsonHelp = new BeanDescriptorJsonHelp<T>(this);
|
||||
this.draftHelp = new BeanDescriptorDraftHelp<T>(this);
|
||||
this.cacheHelp = new BeanDescriptorCacheHelp<>(this, owner.getCacheManager(), deploy.getCacheOptions(), cacheSharableBeans, propertiesOneImported);
|
||||
this.jsonHelp = new BeanDescriptorJsonHelp<>(this);
|
||||
this.draftHelp = new BeanDescriptorDraftHelp<>(this);
|
||||
|
||||
this.docStoreAdapter = owner.createDocStoreBeanAdapter(this, deploy);
|
||||
this.docStoreQueueId = docStoreAdapter.getQueueId();
|
||||
@@ -1362,7 +1362,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
}
|
||||
|
||||
public List<MetaQueryPlanStatistic> collectQueryPlanStatisticsInternal(boolean reset, boolean collectAll) {
|
||||
List<MetaQueryPlanStatistic> list = new ArrayList<MetaQueryPlanStatistic>(queryPlanCache.size());
|
||||
List<MetaQueryPlanStatistic> list = new ArrayList<>(queryPlanCache.size());
|
||||
for (CQueryPlan queryPlan : queryPlanCache.values()) {
|
||||
Snapshot snapshot = queryPlan.getSnapshot(reset);
|
||||
if (collectAll || snapshot.getExecutionCount() > 0) {
|
||||
@@ -2014,7 +2014,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
comparators[i] = createPropertyComparator(sortProperty);
|
||||
}
|
||||
|
||||
return new ElComparatorCompound<T>(comparators);
|
||||
return new ElComparatorCompound<>(comparators);
|
||||
}
|
||||
|
||||
private ElComparator<T> createPropertyComparator(SortByClause.Property sortProp) {
|
||||
@@ -2025,7 +2025,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
if (nullsHigh == null) {
|
||||
nullsHigh = Boolean.TRUE;
|
||||
}
|
||||
return new ElComparatorProperty<T>(elGetValue, sortProp.isAscending(), nullsHigh);
|
||||
return new ElComparatorProperty<>(elGetValue, sortProp.isAscending(), nullsHigh);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2719,7 +2719,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
*/
|
||||
public Map<String, ValuePair> diffForInsert(EntityBean newBean) {
|
||||
|
||||
Map<String, ValuePair> map = new LinkedHashMap<String, ValuePair>();
|
||||
Map<String, ValuePair> map = new LinkedHashMap<>();
|
||||
diffForInsert(null, map, newBean);
|
||||
return map;
|
||||
}
|
||||
@@ -2743,7 +2743,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
* Return the diff comparing the bean values.
|
||||
*/
|
||||
public Map<String, ValuePair> diff(EntityBean newBean, EntityBean oldBean) {
|
||||
Map<String, ValuePair> map = new LinkedHashMap<String, ValuePair>();
|
||||
Map<String, ValuePair> map = new LinkedHashMap<>();
|
||||
diff(null, map, newBean, oldBean);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
BeanDescriptor<?> targetDescriptor = many.getTargetDescriptor();
|
||||
|
||||
List<Object> idList = new ArrayList<Object>();
|
||||
List<Object> idList = new ArrayList<>();
|
||||
Collection<?> actualDetails = BeanCollectionUtil.getActualEntries(details);
|
||||
if (actualDetails == null) {
|
||||
return null;
|
||||
@@ -642,7 +642,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
boolean updateNaturalKey = false;
|
||||
|
||||
Map<String, Object> changes = new LinkedHashMap<String, Object>();
|
||||
Map<String, Object> changes = new LinkedHashMap<>();
|
||||
EntityBean bean = updateRequest.getEntityBean();
|
||||
boolean[] dirtyProperties = updateRequest.getDirtyProperties();
|
||||
for (int i = 0; i < dirtyProperties.length; i++) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class BeanDescriptorDraftHelp<T> {
|
||||
*/
|
||||
private BeanProperty[] resetProperties() {
|
||||
|
||||
List<BeanProperty> list = new ArrayList<BeanProperty>();
|
||||
List<BeanProperty> list = new ArrayList<>();
|
||||
|
||||
BeanProperty[] props = desc.propertiesNonMany();
|
||||
for (BeanProperty prop : props) {
|
||||
|
||||
@@ -145,7 +145,7 @@ public class BeanDescriptorJsonHelp<T> {
|
||||
} else {
|
||||
// read an unmapped property
|
||||
if (unmappedProperties == null) {
|
||||
unmappedProperties = new LinkedHashMap<String, Object>();
|
||||
unmappedProperties = new LinkedHashMap<>();
|
||||
}
|
||||
unmappedProperties.put(key, EJson.parse(parser));
|
||||
}
|
||||
|
||||
@@ -138,19 +138,19 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
private final String serverName;
|
||||
|
||||
private Map<Class<?>, DeployBeanInfo<?>> deployInfoMap = new HashMap<Class<?>, DeployBeanInfo<?>>();
|
||||
private Map<Class<?>, DeployBeanInfo<?>> deployInfoMap = new HashMap<>();
|
||||
|
||||
private final Map<Class<?>, BeanTable> beanTableMap = new HashMap<Class<?>, BeanTable>();
|
||||
private final Map<Class<?>, BeanTable> beanTableMap = new HashMap<>();
|
||||
|
||||
private final Map<String, BeanDescriptor<?>> descMap = new HashMap<String, BeanDescriptor<?>>();
|
||||
private final Map<String, BeanDescriptor<?>> descMap = new HashMap<>();
|
||||
|
||||
private final Map<String, BeanDescriptor<?>> descQueueMap = new HashMap<String, BeanDescriptor<?>>();
|
||||
private final Map<String, BeanDescriptor<?>> descQueueMap = new HashMap<>();
|
||||
|
||||
private final Map<String, BeanManager<?>> beanManagerMap = new HashMap<String, BeanManager<?>>();
|
||||
private final Map<String, BeanManager<?>> beanManagerMap = new HashMap<>();
|
||||
|
||||
private final Map<String, List<BeanDescriptor<?>>> tableToDescMap = new HashMap<String, List<BeanDescriptor<?>>>();
|
||||
private final Map<String, List<BeanDescriptor<?>>> tableToDescMap = new HashMap<>();
|
||||
|
||||
private final Map<String, List<BeanDescriptor<?>>> tableToViewDescMap = new HashMap<String, List<BeanDescriptor<?>>>();
|
||||
private final Map<String, List<BeanDescriptor<?>>> tableToViewDescMap = new HashMap<>();
|
||||
|
||||
private List<BeanDescriptor<?>> immutableDescriptorList;
|
||||
|
||||
@@ -179,12 +179,12 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
/**
|
||||
* Map of base tables to 'with history views' used to support 'as of' queries.
|
||||
*/
|
||||
private final Map<String, String> asOfTableMap = new HashMap<String, String>();
|
||||
private final Map<String, String> asOfTableMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Map of base tables to 'draft' tables.
|
||||
*/
|
||||
private final Map<String, String> draftTableMap = new HashMap<String, String>();
|
||||
private final Map<String, String> draftTableMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Create for a given database dbConfig.
|
||||
@@ -324,7 +324,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
// creates the BeanDescriptors
|
||||
readEntityRelationships();
|
||||
|
||||
List<BeanDescriptor<?>> list = new ArrayList<BeanDescriptor<?>>(descMap.values());
|
||||
List<BeanDescriptor<?>> list = new ArrayList<>(descMap.values());
|
||||
Collections.sort(list, beanDescComparator);
|
||||
immutableDescriptorList = Collections.unmodifiableList(list);
|
||||
|
||||
@@ -353,7 +353,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
Enumeration<URL> resources = classLoader.getResources("ebean.xml");
|
||||
|
||||
List<XmEbean> mappings = new ArrayList<XmEbean>();
|
||||
List<XmEbean> mappings = new ArrayList<>();
|
||||
while (resources.hasMoreElements()) {
|
||||
URL url = resources.nextElement();
|
||||
InputStream is = url.openStream();
|
||||
@@ -479,7 +479,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
baseTable = baseTable.toLowerCase();
|
||||
List<BeanDescriptor<?>> list = tableToDescMap.get(baseTable);
|
||||
if (list == null) {
|
||||
list = new ArrayList<BeanDescriptor<?>>(1);
|
||||
list = new ArrayList<>(1);
|
||||
tableToDescMap.put(baseTable, list);
|
||||
}
|
||||
list.add(desc);
|
||||
@@ -493,7 +493,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
depTable = depTable.toLowerCase();
|
||||
List<BeanDescriptor<?>> list = tableToViewDescMap.get(depTable);
|
||||
if (list == null) {
|
||||
list = new ArrayList<BeanDescriptor<?>>(1);
|
||||
list = new ArrayList<>(1);
|
||||
tableToViewDescMap.put(depTable, list);
|
||||
}
|
||||
list.add(desc);
|
||||
@@ -639,7 +639,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
private <T> BeanDescriptor<T> createEmbedded(Class<T> beanClass) {
|
||||
DeployBeanInfo<T> info = getDeploy(beanClass);
|
||||
return new BeanDescriptor<T>(this, info.getDescriptor());
|
||||
return new BeanDescriptor<>(this, info.getDescriptor());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -859,7 +859,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
// this is the entity bean type - that owns this property
|
||||
Class<?> owningType = prop.getOwningType();
|
||||
|
||||
Set<String> matchSet = new HashSet<String>();
|
||||
Set<String> matchSet = new HashSet<>();
|
||||
|
||||
// get the bean descriptor that holds the mappedBy property
|
||||
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(prop);
|
||||
@@ -1166,7 +1166,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
*/
|
||||
private <T> DeployBeanInfo<T> createDeployBeanInfo(Class<T> beanClass) {
|
||||
|
||||
DeployBeanDescriptor<T> desc = new DeployBeanDescriptor<T>(this, beanClass, serverConfig);
|
||||
DeployBeanDescriptor<T> desc = new DeployBeanDescriptor<>(this, beanClass, serverConfig);
|
||||
|
||||
desc.setUpdateChangesOnly(updateChangesOnly);
|
||||
|
||||
@@ -1179,7 +1179,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
createProperties.createProperties(desc);
|
||||
|
||||
DeployBeanInfo<T> info = new DeployBeanInfo<T>(deployUtil, desc);
|
||||
DeployBeanInfo<T> info = new DeployBeanInfo<>(deployUtil, desc);
|
||||
|
||||
readAnnotations.readInitial(info, eagerFetchLobs);
|
||||
return info;
|
||||
|
||||
+8
-8
@@ -64,14 +64,14 @@ public class BeanLifecycleAdapterFactory {
|
||||
private static class MethodsHolder {
|
||||
|
||||
private boolean hasPersistMethods;
|
||||
private final List<Method> preInserts = new ArrayList<Method>();
|
||||
private final List<Method> postInserts = new ArrayList<Method>();
|
||||
private final List<Method> preUpdates = new ArrayList<Method>();
|
||||
private final List<Method> postUpdates = new ArrayList<Method>();
|
||||
private final List<Method> preDeletes = new ArrayList<Method>();
|
||||
private final List<Method> postDeletes = new ArrayList<Method>();
|
||||
private final List<Method> postLoads = new ArrayList<Method>();
|
||||
private final List<Method> postConstructs = new ArrayList<Method>();
|
||||
private final List<Method> preInserts = new ArrayList<>();
|
||||
private final List<Method> postInserts = new ArrayList<>();
|
||||
private final List<Method> preUpdates = new ArrayList<>();
|
||||
private final List<Method> postUpdates = new ArrayList<>();
|
||||
private final List<Method> preDeletes = new ArrayList<>();
|
||||
private final List<Method> postDeletes = new ArrayList<>();
|
||||
private final List<Method> postLoads = new ArrayList<>();
|
||||
private final List<Method> postConstructs = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Has one of the pre or post insert update delete annotated methods.
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class BeanListHelp<T> implements BeanCollectionHelp<T> {
|
||||
|
||||
BeanList<?> bl = (BeanList<?>) bc;
|
||||
if (bl.getActualList() == null) {
|
||||
bl.setActualList(new ArrayList<Object>());
|
||||
bl.setActualList(new ArrayList<>());
|
||||
}
|
||||
return bl;
|
||||
|
||||
@@ -72,12 +72,12 @@ public final class BeanListHelp<T> implements BeanCollectionHelp<T> {
|
||||
|
||||
@Override
|
||||
public BeanCollection<T> createEmptyNoParent() {
|
||||
return new BeanList<T>();
|
||||
return new BeanList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanCollection<T> createEmpty(EntityBean parentBean) {
|
||||
BeanList<T> beanList = new BeanList<T>(loader, parentBean, propertyName);
|
||||
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
|
||||
if (many != null) {
|
||||
beanList.setModifyListening(many.getModifyListenMode());
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public final class BeanListHelp<T> implements BeanCollectionHelp<T> {
|
||||
@Override
|
||||
public BeanCollection<T> createReference(EntityBean parentBean) {
|
||||
|
||||
BeanList<T> beanList = new BeanList<T>(loader, parentBean, propertyName);
|
||||
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
|
||||
beanList.setModifyListening(many.getModifyListenMode());
|
||||
return beanList;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class BeanManagerFactory {
|
||||
|
||||
public <T> BeanManager<T> create(BeanDescriptor<T> desc) {
|
||||
|
||||
return new BeanManager<T>(desc, persisterFactory.create(desc));
|
||||
return new BeanManager<>(desc, persisterFactory.create(desc));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public final class BeanMapHelp<T> implements BeanCollectionHelp<T> {
|
||||
BeanMap<Object, Object> bm = (BeanMap<Object, Object>) bc;
|
||||
Map<Object, Object> actualMap = bm.getActualMap();
|
||||
if (actualMap == null) {
|
||||
actualMap = new LinkedHashMap<Object, Object>();
|
||||
actualMap = new LinkedHashMap<>();
|
||||
bm.setActualMap(actualMap);
|
||||
}
|
||||
return new Adder(beanProp, actualMap);
|
||||
|
||||
@@ -360,7 +360,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
|
||||
|
||||
private ImportedIdSimple[] createImportedList(BeanPropertyAssoc<?> owner, TableJoinColumn[] cols, BeanProperty[] props, BeanProperty[] others) {
|
||||
|
||||
ArrayList<ImportedIdSimple> list = new ArrayList<ImportedIdSimple>();
|
||||
ArrayList<ImportedIdSimple> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < cols.length; i++) {
|
||||
list.add(createImportedScalar(owner, cols[i], props, others));
|
||||
|
||||
@@ -305,7 +305,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
private List<Object> findIdsByParentId(Object parentId, Transaction t, ArrayList<Object> excludeDetailIds) {
|
||||
|
||||
String rawWhere = deriveWhereParentIdSql(false, "");
|
||||
List<Object> bindValues = new ArrayList<Object>();
|
||||
List<Object> bindValues = new ArrayList<>();
|
||||
bindWhereParentId(bindValues, parentId);
|
||||
|
||||
EbeanServer server = getBeanDescriptor().getEbeanServer();
|
||||
@@ -375,7 +375,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
String expr = rawWhere + inClause;
|
||||
|
||||
List<Object> bindValues = new ArrayList<Object>();
|
||||
List<Object> bindValues = new ArrayList<>();
|
||||
for (int i = 0; i < parentIdList.size(); i++) {
|
||||
bindWhereParentId(bindValues, parentIdList.get(i));
|
||||
}
|
||||
@@ -667,7 +667,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
if (exportedProperties.length == 1) {
|
||||
return parentIds;
|
||||
}
|
||||
List<Object> expandedList = new ArrayList<Object>(parentIds.size() * exportedProperties.length);
|
||||
List<Object> expandedList = new ArrayList<>(parentIds.size() * exportedProperties.length);
|
||||
for (int i = 0; i < parentIds.size(); i++) {
|
||||
for (int y = 0; y < exportedProperties.length; y++) {
|
||||
Object compId = parentIds.get(i);
|
||||
@@ -771,7 +771,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
BeanProperty idProp = descriptor.getIdProperty();
|
||||
|
||||
ArrayList<ExportedProperty> list = new ArrayList<ExportedProperty>();
|
||||
ArrayList<ExportedProperty> list = new ArrayList<>();
|
||||
|
||||
if (idProp != null && idProp.isEmbedded()) {
|
||||
|
||||
@@ -1037,7 +1037,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
liveVal.size();
|
||||
Collection<?> liveBeans = liveVal.getActualDetails();
|
||||
Map<Object,T> liveMap = new LinkedHashMap<Object, T>();
|
||||
Map<Object,T> liveMap = new LinkedHashMap<>();
|
||||
|
||||
for (Object liveBean : liveBeans) {
|
||||
Object id = targetDescriptor.getId((EntityBean) liveBean);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
// Overriding of the columns and use table alias of owning BeanDescriptor
|
||||
BeanEmbeddedMeta overrideMeta = BeanEmbeddedMetaFactory.create(owner, deploy);
|
||||
embeddedProps = overrideMeta.getProperties();
|
||||
embeddedPropsMap = new HashMap<String, BeanProperty>();
|
||||
embeddedPropsMap = new HashMap<>();
|
||||
for (int i = 0; i < embeddedProps.length; i++) {
|
||||
embeddedPropsMap.put(embeddedProps[i].getName(), embeddedProps[i]);
|
||||
}
|
||||
@@ -238,7 +238,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
String rawWhere = deriveWhereParentIdSql(false);
|
||||
|
||||
List<Object> bindValues = new ArrayList<Object>();
|
||||
List<Object> bindValues = new ArrayList<>();
|
||||
bindWhereParentId(bindValues, parentId);
|
||||
|
||||
EbeanServer server = getBeanDescriptor().getEbeanServer();
|
||||
@@ -257,7 +257,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
String expr = rawWhere + inClause;
|
||||
|
||||
List<Object> bindValues = new ArrayList<Object>();
|
||||
List<Object> bindValues = new ArrayList<>();
|
||||
for (int i = 0; i < parentIdList.size(); i++) {
|
||||
bindWhereParentId(bindValues, parentIdList.get(i));
|
||||
}
|
||||
@@ -506,7 +506,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
|
||||
BeanProperty idProp = descriptor.getIdProperty();
|
||||
|
||||
ArrayList<ExportedProperty> list = new ArrayList<ExportedProperty>();
|
||||
ArrayList<ExportedProperty> list = new ArrayList<>();
|
||||
|
||||
if (idProp != null && idProp.isEmbedded()) {
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ public class BeanPropertyCompound extends BeanProperty {
|
||||
|
||||
private final BeanProperty[] scalarProperties;
|
||||
|
||||
private final LinkedHashMap<String, BeanProperty> propertyMap = new LinkedHashMap<String, BeanProperty>();
|
||||
private final LinkedHashMap<String, BeanProperty> propertyMap = new LinkedHashMap<>();
|
||||
|
||||
private final LinkedHashMap<String, CtCompoundPropertyElAdapter> nonScalarMap = new LinkedHashMap<String, CtCompoundPropertyElAdapter>();
|
||||
private final LinkedHashMap<String, CtCompoundPropertyElAdapter> nonScalarMap = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Create the property.
|
||||
|
||||
@@ -31,7 +31,7 @@ public class BeanPropertyCompoundRoot {
|
||||
this.fullBeanName = deploy.getFullBeanName();
|
||||
this.name = deploy.getName();
|
||||
this.setter = deploy.getSetter();
|
||||
this.propList = new ArrayList<BeanPropertyCompoundScalar>();
|
||||
this.propList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public BeanProperty[] getScalarProperties() {
|
||||
|
||||
@@ -52,7 +52,7 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
|
||||
if (bc instanceof BeanSet<?>) {
|
||||
BeanSet<?> beanSet = (BeanSet<?>) bc;
|
||||
if (beanSet.getActualSet() == null) {
|
||||
beanSet.setActualSet(new LinkedHashSet<Object>());
|
||||
beanSet.setActualSet(new LinkedHashSet<>());
|
||||
}
|
||||
return beanSet;
|
||||
|
||||
@@ -76,7 +76,7 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
|
||||
|
||||
@Override
|
||||
public BeanCollection<T> createEmpty(EntityBean ownerBean) {
|
||||
BeanSet<T> beanSet = new BeanSet<T>(loader, ownerBean, propertyName);
|
||||
BeanSet<T> beanSet = new BeanSet<>(loader, ownerBean, propertyName);
|
||||
if (many != null) {
|
||||
beanSet.setModifyListening(many.getModifyListenMode());
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public final class BeanSetHelp<T> implements BeanCollectionHelp<T> {
|
||||
@Override
|
||||
public BeanCollection<T> createReference(EntityBean parentBean) {
|
||||
|
||||
BeanSet<T> beanSet = new BeanSet<T>(loader, parentBean, propertyName);
|
||||
BeanSet<T> beanSet = new BeanSet<>(loader, parentBean, propertyName);
|
||||
beanSet.setModifyListening(many.getModifyListenMode());
|
||||
return beanSet;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user