+{
+ public void execute(M model, int value) {
+ // NOP
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PropertyValueModelTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PropertyValueModelTools.java
index a0510365b0..bbc08efd6d 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PropertyValueModelTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PropertyValueModelTools.java
@@ -20,11 +20,13 @@ import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerTools;
import org.eclipse.jpt.common.utility.model.BooleanSetClosure;
+import org.eclipse.jpt.common.utility.model.IntSetClosure;
import org.eclipse.jpt.common.utility.model.Model;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.predicate.Predicate;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
import org.eclipse.jpt.common.utility.transformer.Transformer;
/**
@@ -888,7 +890,48 @@ public final class PropertyValueModelTools {
}
/**
- * Construct a "set" bi-closure that wraps a boolean "set" closure and
+ * Construct a "set" bi-closure that wraps an int
"set" closure and
+ * forwards its arguments to it, converting the {@link Integer} to
+ * an int
.
+ *
+ * @param the type of the "set" closure's "target" object
+ */
+ public static BiClosure intSetBiClosureAdapter(IntSetClosure super S> closure) {
+ return new IntSetBiClosureAdapter<>(closure);
+ }
+
+ /**
+ * "Set" bi-closure that wraps an int
"set" closure and
+ * forwards its arguments to it, converting the {@link Integer} to
+ * an int
.
+ *
+ * @param the type of the "set" closure's "target" object
+ */
+ public static final class IntSetBiClosureAdapter
+ implements BiClosure
+ {
+ private final IntSetClosure super S> closure;
+
+ public IntSetBiClosureAdapter(IntSetClosure super S> closure) {
+ super();
+ if (closure == null) {
+ throw new NullPointerException();
+ }
+ this.closure = closure;
+ }
+
+ public void execute(S subject, Integer value) {
+ this.closure.execute(subject, value.intValue());
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.closure);
+ }
+ }
+
+ /**
+ * Construct a "set" bi-closure that wraps a boolean
"set" closure and
* forwards its arguments to it, converting the {@link Boolean} to
* a boolean
.
*
@@ -899,7 +942,7 @@ public final class PropertyValueModelTools {
}
/**
- * "Set" bi-closure that wraps a boolean "set" closure and
+ * "Set" bi-closure that wraps a boolean
"set" closure and
* forwards its arguments to it, converting the {@link Boolean} to
* a boolean
.
*
@@ -1122,6 +1165,43 @@ public final class PropertyValueModelTools {
// ********** aspect adapters **********
+ /**
+ * Construct an int
model property aspect adapter for the
+ * specified subject, aspect name, and transformer.
+ *
+ * NB:
+ * The specified transformer will never be passed a null
subject.
+ * Instead, a null
subject will be transformed into a null
+ * Integer
value.
+ *
+ * @param the type of the subject
+ */
+ public static PropertyValueModel modelAspectAdapter(
+ S subject,
+ String aspectName,
+ IntTransformer super S> transformer
+ ) {
+ return modelAspectAdapter(subject, aspectName, TransformerTools.adapt(transformer));
+ }
+
+
+ /**
+ * Construct an int
model property aspect adapter for the
+ * specified subject, aspect name, and transformer.
+ *
+ * NB:
+ * The specified transformer must be able to handle a null
subject.
+ *
+ * @param the type of the subject
+ */
+ public static PropertyValueModel modelAspectAdapter_(
+ S subject,
+ String aspectName,
+ IntTransformer super S> transformer
+ ) {
+ return modelAspectAdapter_(subject, aspectName, TransformerTools.adapt(transformer));
+ }
+
/**
* Construct a boolean model property aspect adapter for the
* specified subject, aspect name, and predicate.
@@ -1195,6 +1275,42 @@ public final class PropertyValueModelTools {
return modelAspectAdapter_(staticModel(subject), aspectName, transformer);
}
+ /**
+ * Construct an int
model property aspect adapter for the
+ * specified subject model, aspect name, and transformer.
+ *
+ * NB:
+ * The specified transformer will never be passed a null
subject.
+ * Instead, a null
subject will be transformed into a null
+ * Integer
value.
+ *
+ * @param the type of the subject
+ */
+ public static > PropertyValueModel modelAspectAdapter(
+ SM subjectModel,
+ String aspectName,
+ IntTransformer super S> transformer
+ ) {
+ return modelAspectAdapter(subjectModel, aspectName, TransformerTools.adapt(transformer));
+ }
+
+ /**
+ * Construct an int
model property aspect adapter for the
+ * specified subject model, aspect name, and transformer.
+ *
+ * NB:
+ * The specified transformer must be able to handle a null
subject.
+ *
+ * @param the type of the subject
+ */
+ public static > PropertyValueModel modelAspectAdapter_(
+ SM subjectModel,
+ String aspectName,
+ IntTransformer super S> transformer
+ ) {
+ return modelAspectAdapter_(subjectModel, aspectName, TransformerTools.adapt(transformer));
+ }
+
/**
* Construct a boolean model property aspect adapter for the
* specified subject model, aspect name, and predicate.
@@ -1344,6 +1460,48 @@ public final class PropertyValueModelTools {
// ********** modifiable aspect adapters **********
+ /**
+ * Construct an int
modifiable property aspect adapter for the
+ * specified subject, aspect name, transformer, and closure.
+ *
+ * NB:
+ * The specified transformer will never be passed a null
subject.
+ * Instead, a null
subject will be transformed into a null
+ * Integer
value.
+ * Likewise, if the subject is null
, the specified closure will
+ * not be executed.
+ *
+ * @param the type of the subject
+ */
+ public static ModifiablePropertyValueModel modifiableModelAspectAdapter(
+ S subject,
+ String aspectName,
+ IntTransformer super S> getTransformer,
+ IntSetClosure super S> setClosure
+ ) {
+ return modifiableModelAspectAdapter(subject, aspectName, TransformerTools.adapt(getTransformer), intSetBiClosureAdapter(setClosure));
+ }
+
+ /**
+ * Construct an int
modifiable property aspect adapter for the
+ * specified subject, aspect name, transformer, and closure.
+ *
+ * NB:
+ * The specified transformer must be able to handle a null
subject.
+ * Likewise, the specified closure must be able to handle a null
+ * subject (i.e. first argument).
+ *
+ * @param the type of the subject
+ */
+ public static ModifiablePropertyValueModel modifiableModelAspectAdapter_(
+ S subject,
+ String aspectName,
+ IntTransformer super S> getTransformer,
+ IntSetClosure super S> setClosure
+ ) {
+ return modifiableModelAspectAdapter_(subject, aspectName, TransformerTools.adapt(getTransformer), intSetBiClosureAdapter(setClosure));
+ }
+
/**
* Construct a boolean modifiable property aspect adapter for the
* specified subject, aspect name, predicate, and closure.
@@ -1429,6 +1587,48 @@ public final class PropertyValueModelTools {
return modifiableModelAspectAdapter_(staticModel(subject), aspectName, getTransformer, setClosure);
}
+ /**
+ * Construct an int
modifiable property aspect adapter for the
+ * specified subject model, aspect name, transformer, and closure.
+ *
+ * NB:
+ * The specified transformer will never be passed a null
subject.
+ * Instead, a null
subject will be transformed into a null
+ * Integer
value.
+ * Likewise, if the subject is null
, the specified closure will
+ * not be executed.
+ *
+ * @param the type of the subject
+ */
+ public static > ModifiablePropertyValueModel modifiableModelAspectAdapter(
+ SM subjectModel,
+ String aspectName,
+ IntTransformer super S> getTransformer,
+ IntSetClosure super S> setClosure
+ ) {
+ return modifiableModelAspectAdapter(subjectModel, aspectName, TransformerTools.adapt(getTransformer), intSetBiClosureAdapter(setClosure));
+ }
+
+ /**
+ * Construct an int
modifiable property aspect adapter for the
+ * specified subject model, aspect name, transformer, and closure.
+ *
+ * NB:
+ * The specified transformer must be able to handle a null
subject.
+ * Likewise, the specified closure must be able to handle a null
+ * subject (i.e. first argument).
+ *
+ * @param the type of the subject
+ */
+ public static > ModifiablePropertyValueModel modifiableModelAspectAdapter_(
+ SM subjectModel,
+ String aspectName,
+ IntTransformer super S> getTransformer,
+ IntSetClosure super S> setClosure
+ ) {
+ return modifiableModelAspectAdapter_(subjectModel, aspectName, TransformerTools.adapt(getTransformer), intSetBiClosureAdapter(setClosure));
+ }
+
/**
* Construct a boolean modifiable property aspect adapter for the
* specified subject model, aspect name, predicate, and closure.
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerTools.java
index 7b2d5500f1..f4bcfb54f8 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerTools.java
@@ -26,7 +26,9 @@ import org.eclipse.jpt.common.utility.internal.ClassTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.exception.DefaultExceptionHandler;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
+import org.eclipse.jpt.common.utility.internal.transformer.int_.IntObjectTransformerAdapter;
import org.eclipse.jpt.common.utility.predicate.Predicate;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
import org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -37,6 +39,15 @@ public final class TransformerTools {
// ********** adapters **********
+ /**
+ * Adapt the specified {@link IntTransformer} to the {@link Transformer} interface.
+ *
+ * @param input: the type of the object passed to the transformer
+ */
+ public static Transformer adapt(IntTransformer super I> intTransformer) {
+ return new IntObjectTransformerAdapter<>(intTransformer);
+ }
+
/**
* Adapt the specified {@link Closure} to the {@link Transformer} interface.
* The returned transformer will always return null
.
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntObjectTransformerAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntObjectTransformerAdapter.java
new file mode 100644
index 0000000000..9efd7a0f47
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntObjectTransformerAdapter.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.transformer.int_;
+
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * Adapt an int
transformer to the standard object transformer
+ * interface.
+ *
+ * @param input: the type of the object passed to the transformer
+ *
+ * @see IntTransformer
+ */
+public class IntObjectTransformerAdapter
+ implements Transformer
+{
+ private final IntTransformer super I> intTransformer;
+
+ public IntObjectTransformerAdapter(IntTransformer super I> intTransformer) {
+ super();
+ if (intTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.intTransformer = intTransformer;
+ }
+
+ public Integer transform(I input) {
+ return Integer.valueOf(this.intTransformer.transform(input));
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.intTransformer);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntTransformerAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntTransformerAdapter.java
new file mode 100644
index 0000000000..60aadc96a0
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntTransformerAdapter.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.transformer.int_;
+
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
+
+/**
+ * Convenience int
transformer that returns zero.
+ *
+ * @param input: the type of the object passed to the transformer
+ */
+public class IntTransformerAdapter
+ implements IntTransformer
+{
+ public int transform(I input) {
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntegerIntTransformerAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntegerIntTransformerAdapter.java
new file mode 100644
index 0000000000..9fc012eeba
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/int_/IntegerIntTransformerAdapter.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.transformer.int_;
+
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * Adapt an {@link Integer} transformer to the int
transformer
+ * interface.
+ *
+ * @param input: the type of the object passed to the transformer
+ *
+ * @see Transformer
+ */
+public class IntegerIntTransformerAdapter
+ implements IntTransformer
+{
+ private final Transformer super I, Integer> transformer;
+
+ public IntegerIntTransformerAdapter(Transformer super I, Integer> transformer) {
+ super();
+ if (transformer == null) {
+ throw new NullPointerException();
+ }
+ this.transformer = transformer;
+ }
+
+ public int transform(I input) {
+ return this.transformer.transform(input).intValue();
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.transformer);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/BooleanSetClosure.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/BooleanSetClosure.java
index 4a16ff275c..f5094b44ed 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/BooleanSetClosure.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/BooleanSetClosure.java
@@ -10,8 +10,8 @@
package org.eclipse.jpt.common.utility.model;
/**
- * Simple interface for implementing a boolean "set" command that takes two
- * arguments, the model and the new value of the model's boolean attribute.
+ * Simple interface for implementing a boolean
"set" command that takes two
+ * arguments, the model and the new value of the model's boolean
attribute.
* The expectation is the closure will have side effects.
*
* Provisional API: This interface is part of an interim API that is still
@@ -26,7 +26,7 @@ public interface BooleanSetClosure {
/**
* The intent of this method is to set the value of the specified
- * model's attribute to the specified boolean value.
+ * model's attribute to the specified boolean
value.
*/
void execute(M model, boolean value);
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/IntSetClosure.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/IntSetClosure.java
new file mode 100644
index 0000000000..9f2d590820
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/IntSetClosure.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.model;
+
+/**
+ * Simple interface for implementing an int
"set" command that takes two
+ * arguments, the model and the new value of the model's int
attribute.
+ * The expectation is the closure will have side effects.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @param the type of the first object passed to the command
+ */
+public interface IntSetClosure {
+
+ /**
+ * The intent of this method is to set the value of the specified
+ * model's attribute to the specified int
value.
+ */
+ void execute(M model, int value);
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/IntTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/IntTransformer.java
new file mode 100644
index 0000000000..c7e42d50c9
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/IntTransformer.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.transformer;
+
+/**
+ * Simple interface for transforming an object into an int
.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @param input: the type of the object passed to the transformer
+ *
+ * @see org.eclipse.jpt.common.utility.transformer.Transformer
+ */
+public interface IntTransformer {
+ /**
+ * Return the transformed int
.
+ * The semantics of "transform" is determined by the
+ * contract between the client and the server.
+ */
+ int transform(I input);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
index dce182b8b9..56a20bc0e4 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -26,9 +26,7 @@ import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
* @since 2.1
*/
public interface EclipseLinkBasicMapping
- extends BasicMapping, EclipseLinkConvertibleMapping, GeneratedValueMapping
+ extends BasicMapping, EclipseLinkConvertibleMapping, GeneratedValueMapping, EclipseLinkMutableMapping
{
- EclipseLinkMutable getMutable();
-
GeneratorContainer getGeneratorContainer(); //supported on Basic in EL 1.1
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
index 0b95c4b09c..a4d642e47f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,14 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.int_.IntTransformerAdapter;
+import org.eclipse.jpt.common.utility.predicate.Predicate;
+import org.eclipse.jpt.common.utility.transformer.IntTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.JpaContextModel;
/**
@@ -34,14 +42,42 @@ public interface EclipseLinkCaching
* If getSpecifiedType() returns null, then return getDefaultType()
*/
EclipseLinkCacheType getType();
+ String TYPE_PROPERTY = "type"; //$NON-NLS-1$
EclipseLinkCacheType getSpecifiedType();
void setSpecifiedType(EclipseLinkCacheType type);
String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
+ Transformer SPECIFIED_TYPE_TRANSFORMER = new SpecifiedTypeTransformer();
+ class SpecifiedTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheType transform(EclipseLinkCaching model) {
+ return model.getSpecifiedType();
+ }
+ }
+ BiClosure SET_SPECIFIED_TYPE_CLOSURE = new SetSpecifiedTypeClosure();
+ class SetSpecifiedTypeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, EclipseLinkCacheType type) {
+ model.setSpecifiedType(type);
+ }
+ }
+
EclipseLinkCacheType getDefaultType();
String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
EclipseLinkCacheType DEFAULT_TYPE = EclipseLinkCacheType.SOFT_WEAK;
+ Transformer DEFAULT_TYPE_TRANSFORMER = new DefaultTypeTransformer();
+ class DefaultTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheType transform(EclipseLinkCaching model) {
+ return model.getDefaultType();
+ }
+ }
// ********** size **********
@@ -51,14 +87,42 @@ public interface EclipseLinkCaching
* If getSpecifiedSize() returns null, then return getDefaultSize()
*/
int getSize();
+ String SIZE_PROPERTY = "size"; //$NON-NLS-1$
Integer getSpecifiedSize();
void setSpecifiedSize(Integer size);
String SPECIFIED_SIZE_PROPERTY = "specifiedSize"; //$NON-NLS-1$
+ Transformer SPECIFIED_SIZE_TRANSFORMER = new SpecifiedSizeTransformer();
+ class SpecifiedSizeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Integer transform(EclipseLinkCaching model) {
+ return model.getSpecifiedSize();
+ }
+ }
+ BiClosure SET_SPECIFIED_SIZE_CLOSURE = new SetSpecifiedSizeClosure();
+ class SetSpecifiedSizeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Integer size) {
+ model.setSpecifiedSize(size);
+ }
+ }
int getDefaultSize();
String DEFAULT_SIZE_PROPERTY = "defaultSize"; //$NON-NLS-1$
int DEFAULT_SIZE = 100;
+ IntTransformer DEFAULT_SIZE_TRANSFORMER = new DefaultSizeTransformer();
+ class DefaultSizeTransformer
+ extends IntTransformerAdapter
+ {
+ @Override
+ public int transform(EclipseLinkCaching model) {
+ return model.getDefaultSize();
+ }
+ }
// ********** shared **********
@@ -68,9 +132,19 @@ public interface EclipseLinkCaching
* If getSpecifiedShared() returns null, then return isDefaultShared()
*/
boolean isShared();
+ String SHARED_PROPERTY = "shared"; //$NON-NLS-1$
+ Predicate SHARED_PREDICATE = new SharedPredicate();
+ class SharedPredicate
+ extends PredicateAdapter
+ {
+ @Override
+ public boolean evaluate(EclipseLinkCaching model) {
+ return model.isShared();
+ }
+ }
Boolean getSpecifiedShared();
-
+
/**
* Specifying shared false
will return the following
* caching settings to their defaults:
@@ -89,10 +163,37 @@ public interface EclipseLinkCaching
*/
void setSpecifiedShared(Boolean shared);
String SPECIFIED_SHARED_PROPERTY = "specifiedShared"; //$NON-NLS-1$
-
- boolean isDefaultShared();
+ Transformer SPECIFIED_SHARED_TRANSFORMER = new SpecifiedSharedTransformer();
+ class SpecifiedSharedTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching model) {
+ return model.getSpecifiedShared();
+ }
+ }
+ BiClosure SET_SPECIFIED_SHARED_CLOSURE = new SetSpecifiedSharedClosure();
+ class SetSpecifiedSharedClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Boolean value) {
+ model.setSpecifiedShared(value);
+ }
+ }
+
+ boolean getDefaultShared();
String DEFAULT_SHARED_PROPERTY = "defaultShared"; //$NON-NLS-1$
boolean DEFAULT_SHARED = true;
+ Predicate DEFAULT_SHARED_PREDICATE = new DefaultSharedPredicate();
+ class DefaultSharedPredicate
+ extends PredicateAdapter
+ {
+ @Override
+ public boolean evaluate(EclipseLinkCaching caching) {
+ return caching.getDefaultShared();
+ }
+ }
// ********** always refresh **********
@@ -102,14 +203,42 @@ public interface EclipseLinkCaching
* If getSpecifiedAlwaysRefresh() returns null, then return isDefaultAlwaysRefresh()
*/
boolean isAlwaysRefresh();
+ String ALWAYS_REFRESH_PROPERTY = "alwaysRefresh"; //$NON-NLS-1$
Boolean getSpecifiedAlwaysRefresh();
void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh);
String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefresh"; //$NON-NLS-1$
+ Transformer SPECIFIED_ALWAYS_REFRESH_TRANSFORMER = new SpecifiedAlwaysRefreshTransformer();
+ class SpecifiedAlwaysRefreshTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching model) {
+ return model.getSpecifiedAlwaysRefresh();
+ }
+ }
+ BiClosure SET_SPECIFIED_ALWAYS_REFRESH_CLOSURE = new SetSpecifiedAlwaysRefreshClosure();
+ class SetSpecifiedAlwaysRefreshClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Boolean value) {
+ model.setSpecifiedAlwaysRefresh(value);
+ }
+ }
- boolean isDefaultAlwaysRefresh();
+ boolean getDefaultAlwaysRefresh();
String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefresh"; //$NON-NLS-1$
boolean DEFAULT_ALWAYS_REFRESH = false;
+ Predicate DEFAULT_ALWAYS_REFRESH_TRANSFORMER = new DefaultAlwaysRefreshPredicate();
+ class DefaultAlwaysRefreshPredicate
+ extends PredicateAdapter
+ {
+ @Override
+ public boolean evaluate(EclipseLinkCaching variable) {
+ return variable.getDefaultAlwaysRefresh();
+ }
+ }
// ********** refresh only if newer **********
@@ -119,14 +248,42 @@ public interface EclipseLinkCaching
* If getSpecifiedRefreshOnlyIfNewer() returns null, then return isDefaultRefreshOnlyIfNewer()
*/
boolean isRefreshOnlyIfNewer();
+ String REFRESH_ONLY_IF_NEWER_PROPERTY = "refreshOnlyIfNewer"; //$NON-NLS-1$
Boolean getSpecifiedRefreshOnlyIfNewer();
void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewer"; //$NON-NLS-1$
+ Transformer SPECIFIED_REFRESH_ONLY_IF_NEWER_TRANSFORMER = new SpecifiedRefreshOnlyIfNewerTransformer();
+ class SpecifiedRefreshOnlyIfNewerTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching model) {
+ return model.getSpecifiedRefreshOnlyIfNewer();
+ }
+ }
+ BiClosure SET_SPECIFIED_REFRESH_ONLY_IF_NEWER_CLOSURE = new SetSpecifiedRefreshOnlyIfNewerClosure();
+ class SetSpecifiedRefreshOnlyIfNewerClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Boolean value) {
+ model.setSpecifiedRefreshOnlyIfNewer(value);
+ }
+ }
- boolean isDefaultRefreshOnlyIfNewer();
+ boolean getDefaultRefreshOnlyIfNewer();
String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewer"; //$NON-NLS-1$
boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
+ Predicate DEFAULT_REFRESH_ONLY_IF_NEWER_TRANSFORMER = new DefaultRefreshOnlyIfNewerPredicate();
+ class DefaultRefreshOnlyIfNewerPredicate
+ extends PredicateAdapter
+ {
+ @Override
+ public boolean evaluate(EclipseLinkCaching variable) {
+ return variable.getDefaultRefreshOnlyIfNewer();
+ }
+ }
// ********** disable hits **********
@@ -136,15 +293,44 @@ public interface EclipseLinkCaching
* If getSpecifiedDisableHits() returns null, then return getDefaultDisableHits()
*/
boolean isDisableHits();
+ String DISABLE_HITS_PROPERTY = "disableHits"; //$NON-NLS-1$
Boolean getSpecifiedDisableHits();
void setSpecifiedDisableHits(Boolean disableHits);
String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHits"; //$NON-NLS-1$
+ Transformer SPECIFIED_DISABLE_HITS_TRANSFORMER = new SpecifiedDisableHitsTransformer();
+ class SpecifiedDisableHitsTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching model) {
+ return model.getSpecifiedDisableHits();
+ }
+ }
+ BiClosure SET_SPECIFIED_DISABLE_HITS_CLOSURE = new SetSpecifiedDisableHitsClosure();
+ class SetSpecifiedDisableHitsClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Boolean value) {
+ model.setSpecifiedDisableHits(value);
+ }
+ }
- boolean isDefaultDisableHits();
+ boolean getDefaultDisableHits();
String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHits"; //$NON-NLS-1$
boolean DEFAULT_DISABLE_HITS = false;
+ Predicate DEFAULT_DISABLE_HITS_TRANSFORMER = new DefaultDisableHitsPredicate();
+ class DefaultDisableHitsPredicate
+ extends PredicateAdapter
+ {
+ @Override
+ public boolean evaluate(EclipseLinkCaching variable) {
+ return variable.getDefaultDisableHits();
+ }
+ }
+
// ********** coordination type **********
@@ -153,14 +339,42 @@ public interface EclipseLinkCaching
* If getSpecifiedCoordinationType() returns null, then return getDefaultCoordinationType()
*/
EclipseLinkCacheCoordinationType getCoordinationType();
+ String COORDINATION_TYPE_PROPERTY = "coordinationType"; //$NON-NLS-1$
EclipseLinkCacheCoordinationType getSpecifiedCoordinationType();
void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType coordinationType);
String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationType"; //$NON-NLS-1$
+ Transformer SPECIFIED_COORDINATION_TYPE_TRANSFORMER = new SpecifiedCoordinationTypeTransformer();
+ class SpecifiedCoordinationTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheCoordinationType transform(EclipseLinkCaching model) {
+ return model.getSpecifiedCoordinationType();
+ }
+ }
+ BiClosure SET_SPECIFIED_COORDINATION_TYPE_CLOSURE = new SetSpecifiedCoordinationTypeClosure();
+ class SetSpecifiedCoordinationTypeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, EclipseLinkCacheCoordinationType type) {
+ model.setSpecifiedCoordinationType(type);
+ }
+ }
EclipseLinkCacheCoordinationType getDefaultCoordinationType();
String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationType"; //$NON-NLS-1$
EclipseLinkCacheCoordinationType DEFAULT_COORDINATION_TYPE = EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES;
+ Transformer DEFAULT_COORDINATION_TYPE_TRANSFORMER = new DefaultCoordinationTypeTransformer();
+ class DefaultCoordinationTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheCoordinationType transform(EclipseLinkCaching model) {
+ return model.getDefaultCoordinationType();
+ }
+ }
// ********** expiry **********
@@ -177,7 +391,25 @@ public interface EclipseLinkCaching
*/
void setExpiry(Integer expiry);
String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
+ Transformer EXPIRY_TRANSFORMER = new ExpiryTransformer();
+ class ExpiryTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Integer transform(EclipseLinkCaching model) {
+ return model.getExpiry();
+ }
+ }
+ BiClosure SET_EXPIRY_CLOSURE = new SetExpiryClosure();
+ class SetExpiryClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, Integer expiry) {
+ model.setExpiry(expiry);
+ }
+ }
+
// ********** expiry time of day **********
@@ -208,14 +440,42 @@ public interface EclipseLinkCaching
* If getSpecifiedExistenceType() returns null, then return getDefaultExistenceType()
*/
EclipseLinkExistenceType getExistenceType();
+ String EXISTENCE_TYPE_PROPERTY = "existenceType"; //$NON-NLS-1$
EclipseLinkExistenceType getSpecifiedExistenceType();
void setSpecifiedExistenceType(EclipseLinkExistenceType type);
String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceType"; //$NON-NLS-1$
+ Transformer SPECIFIED_EXISTENCE_TYPE_TRANSFORMER = new SpecifiedExistenceTypeTransformer();
+ class SpecifiedExistenceTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkExistenceType transform(EclipseLinkCaching model) {
+ return model.getSpecifiedExistenceType();
+ }
+ }
+ BiClosure SET_SPECIFIED_EXISTENCE_TYPE_CLOSURE = new SetSpecifiedExistenceTypeClosure();
+ class SetSpecifiedExistenceTypeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, EclipseLinkExistenceType type) {
+ model.setSpecifiedExistenceType(type);
+ }
+ }
EclipseLinkExistenceType getDefaultExistenceType();
String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceType"; //$NON-NLS-1$
EclipseLinkExistenceType DEFAULT_EXISTENCE_TYPE = EclipseLinkExistenceType.CHECK_DATABASE;
+ Transformer DEFAULT_EXISTENCE_TYPE_TRANSFORMER = new DefaultExistenceTypeTransformer();
+ class DefaultExistenceTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkExistenceType transform(EclipseLinkCaching model) {
+ return model.getDefaultExistenceType();
+ }
+ }
// ********** isolation added in EclipseLink 2.2 **********
@@ -225,13 +485,40 @@ public interface EclipseLinkCaching
* If getSpecifiedIsolation() returns null, then return getDefaultIsolation()
*/
EclipseLinkCacheIsolationType2_2 getIsolation();
+ String ISOLATION_PROPERTY = "isolation"; //$NON-NLS-1$
EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation();
void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation);
String SPECIFIED_ISOLATION_PROPERTY = "specifiedIsolation"; //$NON-NLS-1$
+ Transformer SPECIFIED_ISOLATION_TRANSFORMER = new SpecifiedIsolationTransformer();
+ class SpecifiedIsolationTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheIsolationType2_2 transform(EclipseLinkCaching model) {
+ return model.getSpecifiedIsolation();
+ }
+ }
+ BiClosure SET_SPECIFIED_ISOLATION_CLOSURE = new SetSpecifiedIsolationClosure();
+ class SetSpecifiedIsolationClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching model, EclipseLinkCacheIsolationType2_2 type) {
+ model.setSpecifiedIsolation(type);
+ }
+ }
- EclipseLinkCacheIsolationType2_2 getDefaultIsolation();
+ EclipseLinkCacheIsolationType2_2 getDefaultIsolation();
String DEFAULT_ISOLATION_PROPERTY = "defaultIsolation"; //$NON-NLS-1$
EclipseLinkCacheIsolationType2_2 DEFAULT_ISOLATION = EclipseLinkCacheIsolationType2_2.SHARED;
-
+ Transformer DEFAULT_ISOLATION_TRANSFORMER = new DefaultIsolationTransformer();
+ class DefaultIsolationTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheIsolationType2_2 transform(EclipseLinkCaching model) {
+ return model.getDefaultIsolation();
+ }
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java
index 54ece2853b..e2f005a1be 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -29,6 +29,15 @@ import org.eclipse.jpt.jpa.core.context.AttributeMapping;
public interface EclipseLinkConvertibleMapping {
EclipseLinkConverterContainer getConverterContainer();
+ Transformer CONVERTER_CONTAINER_TRANSFORMER = new ConverterContainerTransformer();
+ class ConverterContainerTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkConverterContainer transform(EclipseLinkConvertibleMapping mapping) {
+ return mapping.getConverterContainer();
+ }
+ }
Transformer> ATTRIBUTE_MAPPING_CONVERTERS_TRANSFORMER = new AttributeMappingConvertersTransformer();
class AttributeMappingConvertersTransformer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
index 154ff8be81..d4d1fd8290 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -24,7 +24,7 @@ import org.eclipse.jpt.jpa.core.context.IdMapping;
* @since 2.1
*/
public interface EclipseLinkIdMapping
- extends IdMapping, EclipseLinkConvertibleMapping
+ extends IdMapping, EclipseLinkConvertibleMapping, EclipseLinkMutableMapping
{
- EclipseLinkMutable getMutable();
+ // combine various interfaces
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
index 77966f4d37..475abfdcbc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
/**
@@ -24,4 +26,13 @@ public interface EclipseLinkJoinFetchMapping
extends AttributeMapping
{
EclipseLinkJoinFetch getJoinFetch();
+ Transformer JOIN_FETCH_TRANSFORMER = new JoinFetchTransformer();
+ class JoinFetchTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkJoinFetch transform(EclipseLinkJoinFetchMapping model) {
+ return model.getJoinFetch();
+ }
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutableMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutableMapping.java
new file mode 100644
index 0000000000..d9246831c2
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutableMapping.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.eclipselink.core.context;
+
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+
+/**
+ * EclipseLink mutable mapping.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.3
+ * @since 2.1
+ */
+public interface EclipseLinkMutableMapping
+ extends AttributeMapping
+{
+ EclipseLinkMutable getMutable();
+ Transformer MUTABLE_TRANSFORMER = new MutableTransformer();
+ class MutableTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkMutable transform(EclipseLinkMutableMapping model) {
+ return model.getMutable();
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
index c942713807..5b8517bc05 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -24,9 +24,7 @@ import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
* @since 2.1
*/
public interface EclipseLinkOneToManyMapping
- extends OneToManyMapping, EclipseLinkRelationshipMapping, EclipseLinkConvertibleMapping
+ extends OneToManyMapping, EclipseLinkRelationshipMapping, EclipseLinkConvertibleMapping, EclipseLinkPrivateOwnedMapping
{
EclipseLinkOneToManyRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
index 846192a66e..7d4bf1856b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -25,9 +25,7 @@ import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
* @since 2.1
*/
public interface EclipseLinkOneToOneMapping
- extends OneToOneMapping, EclipseLinkRelationshipMapping
+ extends OneToOneMapping, EclipseLinkRelationshipMapping, EclipseLinkPrivateOwnedMapping
{
OneToOneRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwnedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwnedMapping.java
new file mode 100644
index 0000000000..eb614456b9
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwnedMapping.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.eclipselink.core.context;
+
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+
+/**
+ * EclipseLink private-owned mapping
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.1
+ * @since 2.1
+ */
+public interface EclipseLinkPrivateOwnedMapping
+ extends AttributeMapping
+{
+ EclipseLinkPrivateOwned getPrivateOwned();
+ Transformer PRIVATE_OWNED_TRANSFORMER = new PrivateOwnedTransformer();
+ class PrivateOwnedTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkPrivateOwned transform(EclipseLinkPrivateOwnedMapping mapping) {
+ return mapping.getPrivateOwned();
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
index 7b100b917f..aff46f3a27 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -24,7 +24,7 @@ import org.eclipse.jpt.jpa.core.context.VersionMapping;
* @since 2.1
*/
public interface EclipseLinkVersionMapping
- extends VersionMapping, EclipseLinkConvertibleMapping
+ extends VersionMapping, EclipseLinkConvertibleMapping, EclipseLinkMutableMapping
{
- EclipseLinkMutable getMutable();
+ // combine various interfaces
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCaching.java
index 4a4efdd053..a77eae6d39 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCaching.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCaching.java
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -32,99 +34,132 @@ public interface EclipseLinkCaching
}
EclipseLinkCacheType getCacheTypeDefault();
+ Transformer CACHE_TYPE_DEFAULT_TRANSFORMER = new CacheTypeDefaultTransformer();
+ class CacheTypeDefaultTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkCacheType transform(EclipseLinkCaching caching) {
+ return caching.getCacheTypeDefault();
+ }
+ }
void setCacheTypeDefault(EclipseLinkCacheType cacheTypeDefault);
- static final String CACHE_TYPE_DEFAULT_PROPERTY = "cacheTypeDefault"; //$NON-NLS-1$
+ String CACHE_TYPE_DEFAULT_PROPERTY = "cacheTypeDefault"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"; //$NON-NLS-1$
- static final EclipseLinkCacheType DEFAULT_CACHE_TYPE_DEFAULT = EclipseLinkCacheType.soft_weak;
+ String ECLIPSELINK_CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"; //$NON-NLS-1$
+ EclipseLinkCacheType DEFAULT_CACHE_TYPE_DEFAULT = EclipseLinkCacheType.soft_weak;
+ BiClosure SET_CACHE_TYPE_DEFAULT_CLOSURE = new SetCacheTypeDefaultClosure();
+ class SetCacheTypeDefaultClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching caching, EclipseLinkCacheType cacheTypeDefault) {
+ caching.setCacheTypeDefault(cacheTypeDefault);
+ }
+ }
Integer getDefaultCacheSizeDefault();
- Transformer DEFAULT_CACHE_SIZE_DEFAULT_TRANSFORMER = new DefaultCacheSizeDefaultTransformer();
- class DefaultCacheSizeDefaultTransformer
- extends TransformerAdapter
- {
- @Override
- public Integer transform(EclipseLinkCaching caching) {
- return caching.getDefaultCacheSizeDefault();
+ Transformer DEFAULT_CACHE_SIZE_DEFAULT_TRANSFORMER = new DefaultCacheSizeDefaultTransformer();
+ class DefaultCacheSizeDefaultTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Integer transform(EclipseLinkCaching caching) {
+ return caching.getDefaultCacheSizeDefault();
+ }
}
- }
Integer getCacheSizeDefault();
void setCacheSizeDefault(Integer cacheSizeDefault);
- static final String CACHE_SIZE_DEFAULT_PROPERTY = "cacheSizeDefault"; //$NON-NLS-1$
+ String CACHE_SIZE_DEFAULT_PROPERTY = "cacheSizeDefault"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE_DEFAULT = "eclipselink.cache.size.default"; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE_DEFAULT = Integer.valueOf(100);
+ String ECLIPSELINK_CACHE_SIZE_DEFAULT = "eclipselink.cache.size.default"; //$NON-NLS-1$
+ Integer DEFAULT_CACHE_SIZE_DEFAULT = Integer.valueOf(100);
Boolean getDefaultSharedCacheDefault();
- Transformer DEFAULT_SHARED_CACHE_DEFAULT_TRANSFORMER = new DefaultSharedCacheDefaultTransformer();
- class DefaultSharedCacheDefaultTransformer
- extends TransformerAdapter
- {
- @Override
- public Boolean transform(EclipseLinkCaching caching) {
- return caching.getDefaultSharedCacheDefault();
+ Transformer DEFAULT_SHARED_CACHE_DEFAULT_TRANSFORMER = new DefaultSharedCacheDefaultTransformer();
+ class DefaultSharedCacheDefaultTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching caching) {
+ return caching.getDefaultSharedCacheDefault();
+ }
}
- }
Boolean getSharedCacheDefault();
+ Transformer SHARED_CACHE_DEFAULT_TRANSFORMER = new SharedCacheDefaultTransformer();
+ class SharedCacheDefaultTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCaching caching) {
+ return caching.getSharedCacheDefault();
+ }
+ }
void setSharedCacheDefault(Boolean sharedCacheDefault);
- static final String SHARED_CACHE_DEFAULT_PROPERTY = "sharedCacheDefault"; //$NON-NLS-1$
+ String SHARED_CACHE_DEFAULT_PROPERTY = "sharedCacheDefault"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_CACHE_SHARED_DEFAULT = "eclipselink.cache.shared.default"; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE_DEFAULT = Boolean.TRUE;
+ String ECLIPSELINK_CACHE_SHARED_DEFAULT = "eclipselink.cache.shared.default"; //$NON-NLS-1$
+ Boolean DEFAULT_SHARED_CACHE_DEFAULT = Boolean.TRUE;
+ BiClosure SET_SHARED_CACHE_DEFAULT_CLOSURE = new SetSharedCacheDefaultClosure();
+ class SetSharedCacheDefaultClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCaching caching, Boolean sharedCacheDefault) {
+ caching.setSharedCacheDefault(sharedCacheDefault);
+ }
+ }
- EclipseLinkCacheType getDefaultCacheType();
- EclipseLinkCacheType getCacheTypeOf(String entityName);
- void setCacheTypeOf(String entityName, EclipseLinkCacheType cacheType);
- static final String CACHE_TYPE_PROPERTY = "cacheType"; //$NON-NLS-1$
+ EclipseLinkCacheType getDefaultEntityCacheType();
+ EclipseLinkCacheType getEntityCacheType(String entityName);
+ void setEntityCacheType(String entityName, EclipseLinkCacheType cacheType);
// EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE = "eclipselink.cache.type."; //$NON-NLS-1$
- static final EclipseLinkCacheType DEFAULT_CACHE_TYPE = EclipseLinkCacheType.soft_weak;
+ String ECLIPSELINK_CACHE_TYPE = "eclipselink.cache.type."; //$NON-NLS-1$
+ EclipseLinkCacheType DEFAULT_ENTITY_CACHE_TYPE = EclipseLinkCacheType.soft_weak;
- Integer getDefaultCacheSize();
- Integer getCacheSizeOf(String entityName);
- void setCacheSizeOf(String entityName, Integer cacheSize);
- static final String CACHE_SIZE_PROPERTY = "cacheSize"; //$NON-NLS-1$
+ Integer getDefaultEntityCacheSize();
+ Integer getEntityCacheSize(String entityName);
+ void setEntityCacheSize(String entityName, Integer cacheSize);
// EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE = "eclipselink.cache.size."; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE = Integer.valueOf(100);
+ String ECLIPSELINK_CACHE_SIZE = "eclipselink.cache.size."; //$NON-NLS-1$
+ Integer DEFAULT_ENTITY_CACHE_SIZE = Integer.valueOf(100);
- Boolean getDefaultSharedCache();
- Boolean getSharedCacheOf(String entityName);
- void setSharedCacheOf(String entityName, Boolean sharedCache);
- static final String SHARED_CACHE_PROPERTY = "sharedCache"; //$NON-NLS-1$
+ Boolean getDefaultEntitySharedCache();
+ Boolean getEntitySharedCache(String entityName);
+ void setEntitySharedCache(String entityName, Boolean sharedCache);
// EclipseLink key string
- static final String ECLIPSELINK_SHARED_CACHE = "eclipselink.cache.shared."; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE = Boolean.TRUE;
+ String ECLIPSELINK_SHARED_CACHE = "eclipselink.cache.shared."; //$NON-NLS-1$
+ Boolean DEFAULT_ENTITY_SHARED_CACHE = Boolean.TRUE;
EclipseLinkFlushClearCache getDefaultFlushClearCache();
- Transformer DEFAULT_FLUSH_CLEAR_CACHE_TRANSFORMER = new DefaultFlushClearCacheTransformer();
- class DefaultFlushClearCacheTransformer
- extends TransformerAdapter
- {
- @Override
- public EclipseLinkFlushClearCache transform(EclipseLinkCaching caching) {
- return caching.getDefaultFlushClearCache();
+ Transformer DEFAULT_FLUSH_CLEAR_CACHE_TRANSFORMER = new DefaultFlushClearCacheTransformer();
+ class DefaultFlushClearCacheTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkFlushClearCache transform(EclipseLinkCaching caching) {
+ return caching.getDefaultFlushClearCache();
+ }
}
- }
EclipseLinkFlushClearCache getFlushClearCache();
void setFlushClearCache(EclipseLinkFlushClearCache newFlushClearCache);
- static final String FLUSH_CLEAR_CACHE_PROPERTY = "flushClearCache"; //$NON-NLS-1$
+ String FLUSH_CLEAR_CACHE_PROPERTY = "flushClearCache"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_FLUSH_CLEAR_CACHE = "eclipselink.flush-clear.cache"; //$NON-NLS-1$
- static final EclipseLinkFlushClearCache DEFAULT_FLUSH_CLEAR_CACHE = EclipseLinkFlushClearCache.drop_invalidate;
+ String ECLIPSELINK_FLUSH_CLEAR_CACHE = "eclipselink.flush-clear.cache"; //$NON-NLS-1$
+ EclipseLinkFlushClearCache DEFAULT_FLUSH_CLEAR_CACHE = EclipseLinkFlushClearCache.drop_invalidate;
void removeDefaultCachingProperties();
- ListIterable getEntities();
- Iterable getEntityNames();
- int getEntitiesSize();
- boolean entityExists(String entity);
- EclipseLinkCachingEntity addEntity(String entity);
- void removeEntity(String entity);
- String ENTITIES_LIST = "entities"; //$NON-NLS-1$
+ ListIterable getCachingEntities();
+ Iterable getCachingEntityNames();
+ int getCachingEntitiesSize();
+ boolean cachingEntityExists(String entityName);
+ EclipseLinkCachingEntity addCachingEntity(String entityName);
+ void removeCachingEntity(String entityName);
+ String CACHING_ENTITIES_LIST = "cachingEntities"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCachingEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCachingEntity.java
index 15c3bb4349..eff3817959 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCachingEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCachingEntity.java
@@ -27,9 +27,9 @@ public class EclipseLinkCachingEntity
private String name;
private EclipseLinkCaching parent;
- public static final String CACHE_TYPE_PROPERTY = EclipseLinkCaching.CACHE_TYPE_PROPERTY;
- public static final String CACHE_SIZE_PROPERTY = EclipseLinkCaching.CACHE_SIZE_PROPERTY;
- public static final String SHARED_CACHE_PROPERTY = EclipseLinkCaching.SHARED_CACHE_PROPERTY;
+ public static final String CACHE_TYPE_PROPERTY = "cacheType"; //$NON-NLS-1$
+ public static final String CACHE_SIZE_PROPERTY = "cacheSize"; //$NON-NLS-1$
+ public static final String SHARED_CACHE_PROPERTY = "sharedCache"; //$NON-NLS-1$
// ********** EclipseLink properties **********
private EclipseLinkCacheType cacheType;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCustomization.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCustomization.java
index 6a33a2cd05..4f2872e76e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCustomization.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkCustomization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,11 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
/**
@@ -24,7 +28,25 @@ public interface EclipseLinkCustomization extends PersistenceUnitProperties
// EclipseLink key string
static final String ECLIPSELINK_THROW_EXCEPTIONS = "eclipselink.orm.throw.exceptions"; //$NON-NLS-1$
static final Boolean DEFAULT_THROW_EXCEPTIONS = Boolean.TRUE;
-
+ Transformer THROW_EXCEPTIONS_TRANSFORMER = new ThrowExceptionsTransformer();
+ class ThrowExceptionsTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkCustomization model) {
+ return model.getThrowExceptions();
+ }
+ }
+ BiClosure SET_THROW_EXCEPTIONS_CLOSURE = new SetThrowExceptionsClosure();
+ class SetThrowExceptionsClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkCustomization model, Boolean name) {
+ model.setThrowExceptions(name);
+ }
+ }
+
EclipseLinkWeaving getDefaultWeaving();
EclipseLinkWeaving getWeaving();
void setWeaving(EclipseLinkWeaving newWeaving);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkGeneralProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkGeneralProperties.java
index 277cabe8ce..cddb45b5fa 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkGeneralProperties.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkGeneralProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
+* Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,10 @@
*******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
/**
@@ -25,5 +29,23 @@ public interface EclipseLinkGeneralProperties
// EclipseLink key string
static final String ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM = "eclipselink.exclude-eclipselink-orm"; //$NON-NLS-1$
static final Boolean DEFAULT_EXCLUDE_ECLIPSELINK_ORM = Boolean.FALSE;
-
+ Transformer EXCLUDE_ECLIPSELINK_ORM_TRANSFORMER = new ExcludeEclipselinkOrmTransformer();
+ class ExcludeEclipselinkOrmTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkGeneralProperties model) {
+ return model.getExcludeEclipselinkOrm();
+ }
+ }
+
+ BiClosure SET_EXCLUDE_ECLIPSELINK_ORM_CLOSURE = new SetExcludeEclipselinkOrmClosure();
+ class SetExcludeEclipselinkOrmClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkGeneralProperties model, Boolean value) {
+ model.setExcludeEclipselinkOrm(value);
+ }
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkLogging.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkLogging.java
index c51f795878..ada0ca4e2e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkLogging.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkLogging.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,10 @@
*******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
/**
@@ -20,59 +24,78 @@ public interface EclipseLinkLogging
EclipseLinkLoggingLevel getDefaultLevel();
EclipseLinkLoggingLevel getLevel();
void setLevel(EclipseLinkLoggingLevel level);
- static final String LEVEL_PROPERTY = "level"; //$NON-NLS-1$
+ String LEVEL_PROPERTY = "level"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_LEVEL = "eclipselink.logging.level"; //$NON-NLS-1$
- static final EclipseLinkLoggingLevel DEFAULT_LEVEL = EclipseLinkLoggingLevel.info;
+ String ECLIPSELINK_LEVEL = "eclipselink.logging.level"; //$NON-NLS-1$
+ EclipseLinkLoggingLevel DEFAULT_LEVEL = EclipseLinkLoggingLevel.info;
Boolean getDefaultTimestamp();
Boolean getTimestamp();
void setTimestamp(Boolean timestamp);
- static final String TIMESTAMP_PROPERTY = "timestamp"; //$NON-NLS-1$
+ String TIMESTAMP_PROPERTY = "timestamp"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_TIMESTAMP = "eclipselink.logging.timestamp"; //$NON-NLS-1$
- static final Boolean DEFAULT_TIMESTAMP = Boolean.TRUE;
+ String ECLIPSELINK_TIMESTAMP = "eclipselink.logging.timestamp"; //$NON-NLS-1$
+ Boolean DEFAULT_TIMESTAMP = Boolean.TRUE;
+ Transformer TIMESTAMP_TRANSFORMER = new TimestampTransformer();
+ class TimestampTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkLogging logging) {
+ return logging.getTimestamp();
+ }
+ }
+
+ BiClosure SET_TIMESTAMP_CLOSURE = new SetTimestampClosure();
+ class SetTimestampClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkLogging logging, Boolean timestamp) {
+ logging.setTimestamp(timestamp);
+ }
+ }
Boolean getDefaultThread();
Boolean getThread();
void setThread(Boolean thread);
- static final String THREAD_PROPERTY = "thread"; //$NON-NLS-1$
+ String THREAD_PROPERTY = "thread"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_THREAD = "eclipselink.logging.thread"; //$NON-NLS-1$
- static final Boolean DEFAULT_THREAD = Boolean.TRUE;
+ String ECLIPSELINK_THREAD = "eclipselink.logging.thread"; //$NON-NLS-1$
+ Boolean DEFAULT_THREAD = Boolean.TRUE;
Boolean getDefaultSession();
Boolean getSession();
void setSession(Boolean session);
- static final String SESSION_PROPERTY = "session"; //$NON-NLS-1$
+ String SESSION_PROPERTY = "session"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_SESSION = "eclipselink.logging.session"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION = Boolean.TRUE;
+ String ECLIPSELINK_SESSION = "eclipselink.logging.session"; //$NON-NLS-1$
+ Boolean DEFAULT_SESSION = Boolean.TRUE;
Boolean getDefaultExceptions();
Boolean getExceptions();
void setExceptions(Boolean exceptions);
- static final String EXCEPTIONS_PROPERTY = "exceptions"; //$NON-NLS-1$
+ String EXCEPTIONS_PROPERTY = "exceptions"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_EXCEPTIONS = "eclipselink.logging.exceptions"; //$NON-NLS-1$
- static final Boolean DEFAULT_EXCEPTIONS = Boolean.FALSE;
+ String ECLIPSELINK_EXCEPTIONS = "eclipselink.logging.exceptions"; //$NON-NLS-1$
+ Boolean DEFAULT_EXCEPTIONS = Boolean.FALSE;
String getDefaultLogFileLocation();
String getLogFileLocation();
void setLogFileLocation(String newLogFileLocation);
- static final String LOG_FILE_LOCATION_PROPERTY = "logFileLocation"; //$NON-NLS-1$
+ String LOG_FILE_LOCATION_PROPERTY = "logFileLocation"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_LOG_FILE_LOCATION = "eclipselink.logging.file"; //$NON-NLS-1$
- static final String DEFAULT_LOG_FILE_LOCATION = null; // No Default
+ String ECLIPSELINK_LOG_FILE_LOCATION = "eclipselink.logging.file"; //$NON-NLS-1$
+ String DEFAULT_LOG_FILE_LOCATION = null; // No Default
String getDefaultLogger();
String getLogger();
void setLogger(String newLogger);
void setLogger(EclipseLinkLogger newLogger);
- static final String LOGGER_PROPERTY = "logger"; //$NON-NLS-1$
+ String LOGGER_PROPERTY = "logger"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_LOGGER = "eclipselink.logging.logger"; //$NON-NLS-1$
- static final String DEFAULT_LOGGER = EclipseLinkLogger.default_logger.getPropertyValue();
- static final String[] RESERVED_LOGGER_NAMES = {EclipseLinkLogger.default_logger.getPropertyValue(), EclipseLinkLogger.java_logger.getPropertyValue(), EclipseLinkLogger.server_logger.getPropertyValue()};
+ String ECLIPSELINK_LOGGER = "eclipselink.logging.logger"; //$NON-NLS-1$
+ String DEFAULT_LOGGER = EclipseLinkLogger.default_logger.getPropertyValue();
+ String[] RESERVED_LOGGER_NAMES = {EclipseLinkLogger.default_logger.getPropertyValue(), EclipseLinkLogger.java_logger.getPropertyValue(), EclipseLinkLogger.server_logger.getPropertyValue()};
String ECLIPSELINK_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.SessionLog"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkOptions.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkOptions.java
index cb41660917..b7fc8e5a23 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkOptions.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkOptions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,10 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
/**
@@ -20,60 +24,79 @@ public interface EclipseLinkOptions
String getDefaultSessionName();
String getSessionName();
void setSessionName(String newSessionName);
- static final String SESSION_NAME_PROPERTY = "sessionName"; //$NON-NLS-1$
+ String SESSION_NAME_PROPERTY = "sessionName"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_SESSION_NAME = "eclipselink.session-name"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_NAME = ""; // no default //$NON-NLS-1$
+ String ECLIPSELINK_SESSION_NAME = "eclipselink.session-name"; //$NON-NLS-1$
+ String DEFAULT_SESSION_NAME = ""; // no default //$NON-NLS-1$
String getDefaultSessionsXml();
String getSessionsXml();
void setSessionsXml(String newSessionsXml);
- static final String SESSIONS_XML_PROPERTY = "sessionsXml"; //$NON-NLS-1$
+ String SESSIONS_XML_PROPERTY = "sessionsXml"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_SESSIONS_XML = "eclipselink.sessions-xml"; //$NON-NLS-1$
- static final String DEFAULT_SESSIONS_XML = ""; // no default //$NON-NLS-1$
+ String ECLIPSELINK_SESSIONS_XML = "eclipselink.sessions-xml"; //$NON-NLS-1$
+ String DEFAULT_SESSIONS_XML = ""; // no default //$NON-NLS-1$
Boolean getDefaultIncludeDescriptorQueries();
Boolean getIncludeDescriptorQueries();
void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries);
- static final String SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY = "includeDescriptorQueriesy"; //$NON-NLS-1$
+ String INCLUDE_DESCRIPTOR_QUERIES_PROPERTY = "includeDescriptorQueries"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES = "eclipselink.session.include.descriptor.queries"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES = Boolean.TRUE;
+ String ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES = "eclipselink.session.include.descriptor.queries"; //$NON-NLS-1$
+ Boolean DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES = Boolean.TRUE;
+ Transformer INCLUDE_DESCRIPTOR_QUERIES_TRANSFORMER = new IncludeDescriptorQueriesTransformer();
+ class IncludeDescriptorQueriesTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public Boolean transform(EclipseLinkOptions options) {
+ return options.getIncludeDescriptorQueries();
+ }
+ }
+
+ BiClosure SET_INCLUDE_DESCRIPTOR_QUERIES_CLOSURE = new SetIncludeDescriptorQueriesClosure();
+ class SetIncludeDescriptorQueriesClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkOptions logging, Boolean value) {
+ logging.setIncludeDescriptorQueries(value);
+ }
+ }
String getDefaultTargetDatabase();
String getTargetDatabase();
void setTargetDatabase(String newTargetDatabase);
void setTargetDatabase(EclipseLinkTargetDatabase newTargetDatabase);
- static final String TARGET_DATABASE_PROPERTY = "targetDatabase"; //$NON-NLS-1$
+ String TARGET_DATABASE_PROPERTY = "targetDatabase"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_TARGET_DATABASE = "eclipselink.target-database"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_DATABASE = EclipseLinkTargetDatabase.auto.getPropertyValue();
+ String ECLIPSELINK_TARGET_DATABASE = "eclipselink.target-database"; //$NON-NLS-1$
+ String DEFAULT_TARGET_DATABASE = EclipseLinkTargetDatabase.auto.getPropertyValue();
String getDefaultTargetServer();
String getTargetServer();
void setTargetServer(String newTargetServer);
void setTargetServer(EclipseLinkTargetServer newTargetServer);
- static final String TARGET_SERVER_PROPERTY = "targetServer"; //$NON-NLS-1$
+ String TARGET_SERVER_PROPERTY = "targetServer"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_TARGET_SERVER = "eclipselink.target-server"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_SERVER = EclipseLinkTargetServer.none.getPropertyValue();
+ String ECLIPSELINK_TARGET_SERVER = "eclipselink.target-server"; //$NON-NLS-1$
+ String DEFAULT_TARGET_SERVER = EclipseLinkTargetServer.none.getPropertyValue();
String getDefaultEventListener();
String getEventListener();
void setEventListener(String newEventListener);
- static final String SESSION_EVENT_LISTENER_PROPERTY = "eventListener"; //$NON-NLS-1$
+ String SESSION_EVENT_LISTENER_PROPERTY = "eventListener"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_SESSION_EVENT_LISTENER = "eclipselink.session-event-listener"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_EVENT_LISTENER = null; // no default
+ String ECLIPSELINK_SESSION_EVENT_LISTENER = "eclipselink.session-event-listener"; //$NON-NLS-1$
+ String DEFAULT_SESSION_EVENT_LISTENER = null; // no default
String ECLIPSELINK_EVENT_LISTENER_CLASS_NAME = "org.eclipse.persistence.sessions.SessionEventListener"; //$NON-NLS-1$
Boolean getDefaultTemporalMutable();
Boolean getTemporalMutable();
void setTemporalMutable(Boolean temporalMutable);
- static final String TEMPORAL_MUTABLE_PROPERTY = "temporalMutable"; //$NON-NLS-1$
+ String TEMPORAL_MUTABLE_PROPERTY = "temporalMutable"; //$NON-NLS-1$
// EclipseLink key string
- static final String ECLIPSELINK_TEMPORAL_MUTABLE = "eclipselink.temporal.mutable"; //$NON-NLS-1$
- static final Boolean DEFAULT_TEMPORAL_MUTABLE = Boolean.FALSE;
+ String ECLIPSELINK_TEMPORAL_MUTABLE = "eclipselink.temporal.mutable"; //$NON-NLS-1$
+ Boolean DEFAULT_TEMPORAL_MUTABLE = Boolean.FALSE;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkSchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkSchemaGeneration.java
index 51c2678b15..dc77fd61f3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkSchemaGeneration.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkSchemaGeneration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,10 @@
*******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
+import org.eclipse.jpt.common.utility.closure.BiClosure;
+import org.eclipse.jpt.common.utility.internal.closure.BiClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
/**
@@ -21,40 +25,78 @@ public interface EclipseLinkSchemaGeneration
EclipseLinkDdlGenerationType getDefaultDdlGenerationType();
EclipseLinkDdlGenerationType getDdlGenerationType();
void setDdlGenerationType(EclipseLinkDdlGenerationType ddlGenerationType);
- static final String DDL_GENERATION_TYPE_PROPERTY = "ddlGenerationType";
+ String DDL_GENERATION_TYPE_PROPERTY = "ddlGenerationType";
// EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_TYPE = "eclipselink.ddl-generation";
- static final EclipseLinkDdlGenerationType DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE = EclipseLinkDdlGenerationType.none;
+ String ECLIPSELINK_DDL_GENERATION_TYPE = "eclipselink.ddl-generation";
+ EclipseLinkDdlGenerationType DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE = EclipseLinkDdlGenerationType.none;
+ Transformer DDL_GENERATION_TYPE_TRANSFORMER = new DdlGenerationTypeTransformer();
+ class DdlGenerationTypeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkDdlGenerationType transform(EclipseLinkSchemaGeneration logging) {
+ return logging.getDdlGenerationType();
+ }
+ }
+
+ BiClosure SET_DDL_GENERATION_TYPE_CLOSURE = new SetDdlGenerationTypeClosure();
+ class SetDdlGenerationTypeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkSchemaGeneration logging, EclipseLinkDdlGenerationType timestamp) {
+ logging.setDdlGenerationType(timestamp);
+ }
+ }
EclipseLinkOutputMode getDefaultOutputMode();
EclipseLinkOutputMode getOutputMode();
void setOutputMode(EclipseLinkOutputMode outputMode); // put
- static final String OUTPUT_MODE_PROPERTY = "outputMode";
+ String OUTPUT_MODE_PROPERTY = "outputMode";
// EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE = "eclipselink.ddl-generation.output-mode";
- static final EclipseLinkOutputMode DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE = null; // No Default
+ String ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE = "eclipselink.ddl-generation.output-mode";
+ EclipseLinkOutputMode DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE = null; // No Default
+ Transformer OUTPUT_MODE_TRANSFORMER = new OutputModeTransformer();
+ class OutputModeTransformer
+ extends TransformerAdapter
+ {
+ @Override
+ public EclipseLinkOutputMode transform(EclipseLinkSchemaGeneration logging) {
+ return logging.getOutputMode();
+ }
+ }
+
+ BiClosure SET_OUTPUT_MODE_CLOSURE = new SetOutputModeClosure();
+ class SetOutputModeClosure
+ extends BiClosureAdapter
+ {
+ @Override
+ public void execute(EclipseLinkSchemaGeneration logging, EclipseLinkOutputMode mode) {
+ logging.setOutputMode(mode);
+ }
+ }
String getDefaultCreateFileName();
String getCreateFileName();
void setCreateFileName(String createFileName);
- static final String CREATE_FILE_NAME_PROPERTY = "createFileName";
+ String CREATE_FILE_NAME_PROPERTY = "createFileName";
// EclipseLink key string
- static final String ECLIPSELINK_CREATE_FILE_NAME = "eclipselink.create-ddl-jdbc-file-name";
- static final String DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME = "createDDL.sql";
+ String ECLIPSELINK_CREATE_FILE_NAME = "eclipselink.create-ddl-jdbc-file-name";
+ String DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME = "createDDL.sql";
String getDefaultDropFileName();
String getDropFileName();
void setDropFileName(String dropFileName);
- static final String DROP_FILE_NAME_PROPERTY = "dropFileName";
+ String DROP_FILE_NAME_PROPERTY = "dropFileName";
// EclipseLink key string
- static final String ECLIPSELINK_DROP_FILE_NAME = "eclipselink.drop-ddl-jdbc-file-name";
- static final String DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME = "dropDDL.sql";
+ String ECLIPSELINK_DROP_FILE_NAME = "eclipselink.drop-ddl-jdbc-file-name";
+ String DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME = "dropDDL.sql";
String getDefaultApplicationLocation();
String getApplicationLocation();
void setApplicationLocation(String applicationLocation);
- static final String APPLICATION_LOCATION_PROPERTY = "applicationLocation";
+ String APPLICATION_LOCATION_PROPERTY = "applicationLocation";
// EclipseLink key string
- static final String ECLIPSELINK_APPLICATION_LOCATION = "eclipselink.application-location";
- static final String DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION = null;
+ String ECLIPSELINK_APPLICATION_LOCATION = "eclipselink.application-location";
+ String DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION = null;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCachingImpl.java
index 9e73e31bff..4a4881b65e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCachingImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCachingImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -44,24 +44,42 @@ public class EclipseLinkJavaCachingImpl
implements EclipseLinkJavaCaching, JavaCacheableReference2_0
{
protected EclipseLinkCacheType specifiedType;
+ protected EclipseLinkCacheType defaultType;
+ protected EclipseLinkCacheType type;
+
protected Integer specifiedSize;
+ protected int defaultSize;
+ protected int size;
+
protected Boolean specifiedShared;
+ protected boolean defaultShared;
+ protected boolean shared;
+
protected Boolean specifiedAlwaysRefresh;
+ protected boolean alwaysRefresh;
+
protected Boolean specifiedRefreshOnlyIfNewer;
+ protected boolean refreshOnlyIfNewer;
+
protected Boolean specifiedDisableHits;
+ protected boolean disableHits;
protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
+ protected EclipseLinkCacheCoordinationType coordinationType;
protected Integer expiry;
protected EclipseLinkJavaTimeOfDay expiryTimeOfDay;
protected boolean existenceChecking;
+
protected EclipseLinkExistenceType specifiedExistenceType;
protected EclipseLinkExistenceType defaultExistenceType;
+ protected EclipseLinkExistenceType existenceType;
protected final Cacheable2_0 cacheable;
protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
+ protected EclipseLinkCacheIsolationType2_2 isolation;
public EclipseLinkJavaCachingImpl(EclipseLinkJavaNonEmbeddableTypeMapping parent) {
super(parent);
@@ -120,17 +138,49 @@ public class EclipseLinkJavaCachingImpl
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
+ this.setDefaultType(this.buildDefaultType());
+ this.setType(this.buildType());
+
+ this.setDefaultSize(this.buildDefaultSize());
+ this.setSize(this.buildSize());
+
+ this.setDefaultShared(this.buildDefaultShared());
+ this.setShared(this.buildShared());
+
+ this.setAlwaysRefresh(this.buildAlwaysRefresh());
+
+ this.setRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer());
+
+ this.setDisableHits(this.buildDisableHits());
+
+ this.setCoordinationType(this.buildCoordinationType());
+
if (this.expiryTimeOfDay != null) {
this.expiryTimeOfDay.update(monitor);
}
+
this.setDefaultExistenceType(this.buildDefaultExistenceType());
+ this.setExistenceType(this.buildExistenceType());
+
this.cacheable.update(monitor);
+
+ this.setIsolation(this.buildIsolation());
}
// ********** type **********
public EclipseLinkCacheType getType() {
+ return this.type;
+ }
+
+ protected void setType(EclipseLinkCacheType type) {
+ EclipseLinkCacheType old = this.type;
+ this.firePropertyChanged(TYPE_PROPERTY, old, this.type = type);
+ }
+
+ protected EclipseLinkCacheType buildType() {
return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
}
@@ -154,12 +204,21 @@ public class EclipseLinkJavaCachingImpl
}
public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.isBlank(puDefaultCacheTypeName)) {
+ return this.defaultType;
+ }
+
+ protected void setDefaultType(EclipseLinkCacheType type) {
+ EclipseLinkCacheType old = this.defaultType;
+ this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, this.defaultType = type);
+ }
+
+ protected EclipseLinkCacheType buildDefaultType() {
+ String puDefaultCacheTypeName = this.getPersistenceUnit().getDefaultCacheTypePropertyValue();
+ if (StringTools.isNotBlank(puDefaultCacheTypeName)) {
try {
return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
} catch (IllegalArgumentException exception) {
- //no match, return default
+ // no match, return default
}
}
return DEFAULT_TYPE;
@@ -168,6 +227,15 @@ public class EclipseLinkJavaCachingImpl
// ********** size **********
public int getSize() {
+ return this.size;
+ }
+
+ protected void setSize(int size) {
+ int old = this.size;
+ this.firePropertyChanged(SIZE_PROPERTY, old, this.size = size);
+ }
+
+ protected int buildSize() {
return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.getDefaultSize();
}
@@ -186,17 +254,25 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedSize_(Integer size) {
Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
+ this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, this.specifiedSize = size);
}
public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.isBlank(puDefaultCacheSize)) {
+ return this.defaultSize;
+ }
+
+ protected void setDefaultSize(int size) {
+ int old = this.defaultSize;
+ this.firePropertyChanged(DEFAULT_SIZE_PROPERTY, old, this.defaultSize = size);
+ }
+
+ protected int buildDefaultSize() {
+ String puDefaultCacheSize = this.getPersistenceUnit().getDefaultCacheSizePropertyValue();
+ if (StringTools.isNotBlank(puDefaultCacheSize)) {
try {
return Integer.valueOf(puDefaultCacheSize).intValue();
} catch (NumberFormatException exception) {
- //couldn't parse, return default
+ // unable to parse, return default
}
}
return DEFAULT_SIZE;
@@ -206,7 +282,16 @@ public class EclipseLinkJavaCachingImpl
// ********** shared **********
public boolean isShared() {
- return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.isDefaultShared();
+ return this.shared;
+ }
+
+ protected void setShared(boolean shared) {
+ boolean old = this.shared;
+ this.firePropertyChanged(SHARED_PROPERTY, old, this.shared = shared);
+ }
+
+ protected boolean buildShared() {
+ return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.getDefaultShared();
}
public Boolean getSpecifiedShared() {
@@ -235,16 +320,34 @@ public class EclipseLinkJavaCachingImpl
this.firePropertyChanged(SPECIFIED_SHARED_PROPERTY, old, shared);
}
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.isBlank(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache).booleanValue() : DEFAULT_SHARED;
+ public boolean getDefaultShared() {
+ return this.defaultShared;
+ }
+
+ protected void setDefaultShared(boolean shared) {
+ boolean old = this.defaultShared;
+ this.firePropertyChanged(DEFAULT_SHARED_PROPERTY, old, this.defaultShared = shared);
+ }
+
+ protected boolean buildDefaultShared() {
+ String puDefaultSharedCache = this.getPersistenceUnit().getDefaultCacheSharedPropertyValue();
+ return StringTools.isNotBlank(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache).booleanValue() : DEFAULT_SHARED;
}
// ********** always refresh **********
public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.isDefaultAlwaysRefresh();
+ return this.alwaysRefresh;
+ }
+
+ protected void setAlwaysRefresh(boolean alwaysRefresh) {
+ boolean old = this.alwaysRefresh;
+ this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, this.alwaysRefresh = alwaysRefresh);
+ }
+
+ protected boolean buildAlwaysRefresh() {
+ return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.getDefaultAlwaysRefresh();
}
public Boolean getSpecifiedAlwaysRefresh() {
@@ -262,11 +365,10 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
+ this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, this.specifiedAlwaysRefresh = alwaysRefresh);
}
- public boolean isDefaultAlwaysRefresh() {
+ public boolean getDefaultAlwaysRefresh() {
return DEFAULT_ALWAYS_REFRESH;
}
@@ -274,7 +376,16 @@ public class EclipseLinkJavaCachingImpl
// ********** refresh only if newer **********
public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.isDefaultRefreshOnlyIfNewer();
+ return this.refreshOnlyIfNewer;
+ }
+
+ protected void setRefreshOnlyIfNewer(boolean refreshOnlyIfNewer) {
+ boolean old = this.refreshOnlyIfNewer;
+ this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, this.refreshOnlyIfNewer = refreshOnlyIfNewer);
+ }
+
+ protected boolean buildRefreshOnlyIfNewer() {
+ return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.getDefaultRefreshOnlyIfNewer();
}
public Boolean getSpecifiedRefreshOnlyIfNewer() {
@@ -292,11 +403,10 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
+ this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer);
}
- public boolean isDefaultRefreshOnlyIfNewer() {
+ public boolean getDefaultRefreshOnlyIfNewer() {
return DEFAULT_REFRESH_ONLY_IF_NEWER;
}
@@ -304,7 +414,16 @@ public class EclipseLinkJavaCachingImpl
// ********** disable hits **********
public boolean isDisableHits() {
- return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.isDefaultDisableHits();
+ return this.disableHits;
+ }
+
+ protected void setDisableHits(boolean disableHits) {
+ boolean old = this.disableHits;
+ this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, this.disableHits = disableHits);
+ }
+
+ protected boolean buildDisableHits() {
+ return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.getDefaultDisableHits();
}
public Boolean getSpecifiedDisableHits() {
@@ -322,11 +441,10 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedDisableHits_(Boolean disableHits) {
Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
+ this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, this.specifiedDisableHits = disableHits);
}
- public boolean isDefaultDisableHits() {
+ public boolean getDefaultDisableHits() {
return DEFAULT_DISABLE_HITS;
}
@@ -334,6 +452,15 @@ public class EclipseLinkJavaCachingImpl
// ********** coordination type **********
public EclipseLinkCacheCoordinationType getCoordinationType() {
+ return this.coordinationType;
+ }
+
+ protected void setCoordinationType(EclipseLinkCacheCoordinationType type) {
+ EclipseLinkCacheCoordinationType old = this.coordinationType;
+ this.firePropertyChanged(COORDINATION_TYPE_PROPERTY, old, this.coordinationType = type);
+ }
+
+ protected EclipseLinkCacheCoordinationType buildCoordinationType() {
return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.getDefaultCoordinationType();
}
@@ -352,8 +479,7 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, this.specifiedCoordinationType = type);
}
public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
@@ -379,8 +505,7 @@ public class EclipseLinkJavaCachingImpl
protected void setExpiry_(Integer expiry) {
Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
+ this.firePropertyChanged(EXPIRY_PROPERTY, old, this.expiry = expiry);
}
@@ -422,10 +547,9 @@ public class EclipseLinkJavaCachingImpl
this.setExpiryTimeOfDay(null);
}
- public void setExpiryTimeOfDay(EclipseLinkJavaTimeOfDay timeOfDay) {
+ protected void setExpiryTimeOfDay(EclipseLinkJavaTimeOfDay timeOfDay) {
EclipseLinkJavaTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
+ this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, this.expiryTimeOfDay = timeOfDay);
}
protected void syncExpiryTimeOfDay(TimeOfDayAnnotation timeOfDayAnnotation, IProgressMonitor monitor) {
@@ -467,14 +591,22 @@ public class EclipseLinkJavaCachingImpl
protected void setExistenceChecking_(boolean existenceChecking) {
boolean old = this.existenceChecking;
- this.existenceChecking = existenceChecking;
- this.firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, old, existenceChecking);
+ this.firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, old, this.existenceChecking = existenceChecking);
}
// ********** existence type **********
public EclipseLinkExistenceType getExistenceType() {
+ return this.existenceType;
+ }
+
+ protected void setExistenceType(EclipseLinkExistenceType type) {
+ EclipseLinkExistenceType old = this.existenceType;
+ this.firePropertyChanged(EXISTENCE_TYPE_PROPERTY, old, this.existenceType = type);
+ }
+
+ protected EclipseLinkExistenceType buildExistenceType() {
return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
}
@@ -494,8 +626,7 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, this.specifiedExistenceType = type);
}
protected EclipseLinkExistenceType buildSpecifiedExistenceType(ExistenceCheckingAnnotation ecAnnotation) {
@@ -508,8 +639,7 @@ public class EclipseLinkJavaCachingImpl
protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, this.defaultExistenceType = type);
}
protected EclipseLinkExistenceType buildDefaultExistenceType() {
@@ -551,6 +681,15 @@ public class EclipseLinkJavaCachingImpl
// ********** isolation **********
public EclipseLinkCacheIsolationType2_2 getIsolation() {
+ return this.isolation;
+ }
+
+ protected void setIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
+ EclipseLinkCacheIsolationType2_2 old = this.isolation;
+ this.firePropertyChanged(ISOLATION_PROPERTY, old, this.isolation = isolation);
+ }
+
+ protected EclipseLinkCacheIsolationType2_2 buildIsolation() {
return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.getDefaultIsolation();
}
@@ -569,8 +708,7 @@ public class EclipseLinkJavaCachingImpl
protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
+ this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, this.specifiedIsolation = isolation);
}
public EclipseLinkCacheIsolationType2_2 getDefaultIsolation() {
@@ -613,6 +751,11 @@ public class EclipseLinkJavaCachingImpl
return this.parent;
}
+ @Override
+ public EclipseLinkPersistenceUnit getPersistenceUnit() {
+ return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
+ }
+
protected JavaPersistentType getPersistentType() {
return this.getTypeMapping().getPersistentType();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCachingImpl.java
index fc06957aac..63e9d20bb2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCachingImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCachingImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -43,37 +43,49 @@ public class EclipseLinkOrmCachingImpl
extends AbstractOrmXmlContextModel
implements EclipseLinkCaching, OrmCacheableReference2_0
{
+ /** This is present only if it should actually be used. */
+ protected EclipseLinkJavaCaching javaCachingForDefaults;
+
protected EclipseLinkCacheType specifiedType;
protected EclipseLinkCacheType defaultType = DEFAULT_TYPE;
+ protected EclipseLinkCacheType type = DEFAULT_TYPE;
protected Integer specifiedSize;
protected int defaultSize = DEFAULT_SIZE;
+ protected int size = DEFAULT_SIZE;
protected Boolean specifiedShared;
protected boolean defaultShared = DEFAULT_SHARED;
+ protected boolean shared = DEFAULT_SHARED;
protected Boolean specifiedAlwaysRefresh;
protected boolean defaultAlwaysRefresh = DEFAULT_ALWAYS_REFRESH;
+ protected boolean alwaysRefresh = DEFAULT_ALWAYS_REFRESH;
protected Boolean specifiedRefreshOnlyIfNewer;
protected boolean defaultRefreshOnlyIfNewer = DEFAULT_REFRESH_ONLY_IF_NEWER;
+ protected boolean refreshOnlyIfNewer = DEFAULT_REFRESH_ONLY_IF_NEWER;
protected Boolean specifiedDisableHits;
protected boolean defaultDisableHits = DEFAULT_DISABLE_HITS;
+ protected boolean disableHits = DEFAULT_DISABLE_HITS;
protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
protected EclipseLinkCacheCoordinationType defaultCoordinationType = DEFAULT_COORDINATION_TYPE;
+ protected EclipseLinkCacheCoordinationType coordinationType = DEFAULT_COORDINATION_TYPE;
protected Integer expiry;
protected EclipseLinkOrmTimeOfDay expiryTimeOfDay;
protected EclipseLinkExistenceType specifiedExistenceType;
protected EclipseLinkExistenceType defaultExistenceType = DEFAULT_EXISTENCE_TYPE;
+ protected EclipseLinkExistenceType existenceType = DEFAULT_EXISTENCE_TYPE;
protected final Cacheable2_0 cacheable;
protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
protected EclipseLinkCacheIsolationType2_2 defaultIsolation = DEFAULT_ISOLATION;
+ protected EclipseLinkCacheIsolationType2_2 isolation = DEFAULT_ISOLATION;
public EclipseLinkOrmCachingImpl(EclipseLinkOrmNonEmbeddableTypeMapping parent) {
@@ -127,37 +139,56 @@ public class EclipseLinkOrmCachingImpl
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+ this.javaCachingForDefaults = this.buildJavaCachingForDefaults();
+
+ this.setDefaultType(this.buildDefaultType());
+ this.setType(this.buildType());
+
+ this.setDefaultSize(this.buildDefaultSize());
+ this.setSize(this.buildSize());
+
+ this.setDefaultShared(this.buildDefaultShared());
+ this.setShared(this.buildShared());
+
+ this.setDefaultAlwaysRefresh(this.buildDefaultAlwaysRefresh());
+ this.setAlwaysRefresh(this.buildAlwaysRefresh());
- boolean xmlCacheNotSpecified = (this.getXmlCache() == null);
- EclipseLinkJavaCaching javaCaching = this.getJavaCachingForDefaults();
- boolean javaCacheSpecified = (javaCaching != null);
- boolean useJavaValue = (xmlCacheNotSpecified && javaCacheSpecified);
+ this.setDefaultRefreshOnlyIfNewer(this.buildDefaultRefreshOnlyIfNewer());
+ this.setRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer());
- this.setDefaultType(useJavaValue ? javaCaching.getType() : DEFAULT_TYPE);
- this.setDefaultSize(useJavaValue ? javaCaching.getSize() : DEFAULT_SIZE);
- this.setDefaultShared(useJavaValue ? javaCaching.isShared() : DEFAULT_SHARED);
- this.setDefaultAlwaysRefresh(useJavaValue ? javaCaching.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH);
- this.setDefaultRefreshOnlyIfNewer(useJavaValue ? javaCaching.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER);
- this.setDefaultDisableHits(useJavaValue ? javaCaching.isDisableHits() : DEFAULT_DISABLE_HITS);
+ this.setDefaultDisableHits(this.buildDefaultDisableHits());
+ this.setDisableHits(this.buildDisableHits());
- this.setDefaultCoordinationType(useJavaValue ? javaCaching.getCoordinationType() : DEFAULT_COORDINATION_TYPE);
+ this.setDefaultCoordinationType(this.buildDefaultCoordinationType());
+ this.setCoordinationType(this.buildCoordinationType());
if (this.expiryTimeOfDay != null) {
this.expiryTimeOfDay.update(monitor);
}
// existence checking is its own xml attribute, it is not part of the cache xml element
- this.setDefaultExistenceType(javaCacheSpecified ? javaCaching.getExistenceType() : DEFAULT_EXISTENCE_TYPE);
+ this.setDefaultExistenceType(this.buildDefaultExistenceType());
+ this.setExistenceType(this.buildExistenceType());
this.cacheable.update(monitor);
- this.setDefaultIsolation(useJavaValue ? javaCaching.getIsolation() : DEFAULT_ISOLATION);
+ this.setDefaultIsolation(this.buildDefaultIsolation());
+ this.setIsolation(this.buildIsolation());
}
// ********** type **********
public EclipseLinkCacheType getType() {
+ return this.type;
+ }
+
+ protected void setType(EclipseLinkCacheType type) {
+ EclipseLinkCacheType old = this.type;
+ this.firePropertyChanged(TYPE_PROPERTY, old, this.type = type);
+ }
+
+ protected EclipseLinkCacheType buildType() {
return (this.specifiedType != null) ? this.specifiedType : this.defaultType;
}
@@ -180,8 +211,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedType_(EclipseLinkCacheType type) {
EclipseLinkCacheType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, this.specifiedType = type);
}
protected EclipseLinkCacheType buildSpecifiedType() {
@@ -190,27 +220,39 @@ public class EclipseLinkOrmCachingImpl
}
public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.isBlank(puDefaultCacheTypeName)) {
+ return this.defaultType;
+ }
+
+ protected EclipseLinkCacheType buildDefaultType() {
+ String puDefaultCacheTypeName = this.getPersistenceUnit().getDefaultCacheTypePropertyValue();
+ if (StringTools.isNotBlank(puDefaultCacheTypeName)) {
try {
return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
} catch (IllegalArgumentException exception) {
- //no match, return default
+ // could not parse, fall through
}
}
- return this.defaultType;
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.getType() : DEFAULT_TYPE;
}
protected void setDefaultType(EclipseLinkCacheType type) {
EclipseLinkCacheType old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, this.defaultType = type);
}
// ********** size **********
public int getSize() {
+ return this.size;
+ }
+
+ protected void setSize(int size) {
+ int old = this.size;
+ this.firePropertyChanged(SIZE_PROPERTY, old, this.size = size);
+ }
+
+ protected int buildSize() {
return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.defaultSize;
}
@@ -233,8 +275,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedSize_(Integer size) {
Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
+ this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, this.specifiedSize = size);
}
protected Integer buildSpecifiedSize() {
@@ -243,27 +284,39 @@ public class EclipseLinkOrmCachingImpl
}
public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.isBlank(puDefaultCacheSize)) {
+ return this.defaultSize;
+ }
+
+ protected int buildDefaultSize() {
+ String puDefaultCacheSize = this.getPersistenceUnit().getDefaultCacheSizePropertyValue();
+ if (StringTools.isNotBlank(puDefaultCacheSize)) {
try {
return Integer.valueOf(puDefaultCacheSize).intValue();
} catch (NumberFormatException exception) {
- //couldn't parse, return default
+ // could not parse, fall through
}
}
- return this.defaultSize;
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.getSize() : DEFAULT_SIZE;
}
protected void setDefaultSize(int size) {
int old = this.defaultSize;
- this.defaultSize = size;
- this.firePropertyChanged(DEFAULT_SIZE_PROPERTY, old, size);
+ this.firePropertyChanged(DEFAULT_SIZE_PROPERTY, old, this.defaultSize = size);
}
// ********** shared **********
public boolean isShared() {
+ return this.shared;
+ }
+
+ protected void setShared(boolean shared) {
+ boolean old = this.shared;
+ this.firePropertyChanged(SHARED_PROPERTY, old, this.shared = shared);
+ }
+
+ protected boolean buildShared() {
return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.defaultShared;
}
@@ -302,21 +355,36 @@ public class EclipseLinkOrmCachingImpl
return (xmlCache == null) ? null : xmlCache.getShared();
}
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.isBlank(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache).booleanValue() : this.defaultShared;
+ public boolean getDefaultShared() {
+ return this.defaultShared;
+ }
+
+ protected boolean buildDefaultShared() {
+ String puDefaultSharedCache = this.getPersistenceUnit().getDefaultCacheSharedPropertyValue();
+ if (StringTools.isNotBlank(puDefaultSharedCache)) {
+ return Boolean.valueOf(puDefaultSharedCache).booleanValue();
+ }
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.isShared() : DEFAULT_SHARED;
}
protected void setDefaultShared(boolean shared) {
boolean old = this.defaultShared;
- this.defaultShared = shared;
- this.firePropertyChanged(DEFAULT_SHARED_PROPERTY, old, shared);
+ this.firePropertyChanged(DEFAULT_SHARED_PROPERTY, old, this.defaultShared = shared);
}
// ********** always refresh **********
public boolean isAlwaysRefresh() {
+ return this.alwaysRefresh;
+ }
+
+ protected void setAlwaysRefresh(boolean alwaysRefresh) {
+ boolean old = this.alwaysRefresh;
+ this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, this.alwaysRefresh = alwaysRefresh);
+ }
+
+ protected boolean buildAlwaysRefresh() {
return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.defaultAlwaysRefresh;
}
@@ -339,8 +407,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
+ this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, this.specifiedAlwaysRefresh = alwaysRefresh);
}
protected Boolean buildSpecifiedAlwaysRefresh() {
@@ -348,20 +415,32 @@ public class EclipseLinkOrmCachingImpl
return (xmlCache == null) ? null : xmlCache.getAlwaysRefresh();
}
- public boolean isDefaultAlwaysRefresh() {
+ public boolean getDefaultAlwaysRefresh() {
return this.defaultAlwaysRefresh;
}
protected void setDefaultAlwaysRefresh(boolean alwaysRefresh) {
boolean old = this.defaultAlwaysRefresh;
- this.defaultAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(DEFAULT_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
+ this.firePropertyChanged(DEFAULT_ALWAYS_REFRESH_PROPERTY, old, this.defaultAlwaysRefresh = alwaysRefresh);
+ }
+
+ protected boolean buildDefaultAlwaysRefresh() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH;
}
// ********** refresh only if newer **********
public boolean isRefreshOnlyIfNewer() {
+ return this.refreshOnlyIfNewer;
+ }
+
+ protected void setRefreshOnlyIfNewer(boolean refreshOnlyIfNewer) {
+ boolean old = this.refreshOnlyIfNewer;
+ this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, this.refreshOnlyIfNewer = refreshOnlyIfNewer);
+ }
+
+ protected boolean buildRefreshOnlyIfNewer() {
return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.defaultRefreshOnlyIfNewer;
}
@@ -384,8 +463,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
+ this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer);
}
protected Boolean buildSpecifiedRefreshOnlyIfNewer() {
@@ -393,20 +471,32 @@ public class EclipseLinkOrmCachingImpl
return (xmlCache == null) ? null : xmlCache.getRefreshOnlyIfNewer();
}
- public boolean isDefaultRefreshOnlyIfNewer() {
+ public boolean getDefaultRefreshOnlyIfNewer() {
return this.defaultRefreshOnlyIfNewer;
}
protected void setDefaultRefreshOnlyIfNewer(boolean refreshOnlyIfNewer) {
boolean old = this.defaultRefreshOnlyIfNewer;
- this.defaultRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
+ this.firePropertyChanged(DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY, old, this.defaultRefreshOnlyIfNewer = refreshOnlyIfNewer);
+ }
+
+ protected boolean buildDefaultRefreshOnlyIfNewer() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER;
}
// ********** disable hits **********
public boolean isDisableHits() {
+ return this.disableHits;
+ }
+
+ protected void setDisableHits(boolean disableHits) {
+ boolean old = this.disableHits;
+ this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, this.disableHits = disableHits);
+ }
+
+ protected boolean buildDisableHits() {
return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.defaultDisableHits;
}
@@ -429,8 +519,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedDisableHits_(Boolean disableHits) {
Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
+ this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, this.specifiedDisableHits = disableHits);
}
protected Boolean buildSpecifiedDisableHits() {
@@ -438,20 +527,32 @@ public class EclipseLinkOrmCachingImpl
return (xmlCache == null) ? null : xmlCache.getDisableHits();
}
- public boolean isDefaultDisableHits() {
+ public boolean getDefaultDisableHits() {
return this.defaultDisableHits;
}
protected void setDefaultDisableHits(boolean disableHits) {
boolean old = this.defaultDisableHits;
- this.defaultDisableHits = disableHits;
- this.firePropertyChanged(DEFAULT_DISABLE_HITS_PROPERTY, old, disableHits);
+ this.firePropertyChanged(DEFAULT_DISABLE_HITS_PROPERTY, old, this.defaultDisableHits = disableHits);
+ }
+
+ protected boolean buildDefaultDisableHits() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.isDisableHits() : DEFAULT_DISABLE_HITS;
}
// ********** coordination type **********
public EclipseLinkCacheCoordinationType getCoordinationType() {
+ return this.coordinationType;
+ }
+
+ protected void setCoordinationType(EclipseLinkCacheCoordinationType type) {
+ EclipseLinkCacheCoordinationType old = this.coordinationType;
+ this.firePropertyChanged(COORDINATION_TYPE_PROPERTY, old, this.coordinationType = type);
+ }
+
+ protected EclipseLinkCacheCoordinationType buildCoordinationType() {
return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.defaultCoordinationType;
}
@@ -474,8 +575,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, this.specifiedCoordinationType = type);
}
protected EclipseLinkCacheCoordinationType buildSpecifiedCoordinationType() {
@@ -489,8 +589,11 @@ public class EclipseLinkOrmCachingImpl
protected void setDefaultCoordinationType(EclipseLinkCacheCoordinationType type) {
EclipseLinkCacheCoordinationType old= this.defaultCoordinationType;
- this.defaultCoordinationType = type;
- this.firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, old, this.defaultCoordinationType = type);
+ }
+
+ protected EclipseLinkCacheCoordinationType buildDefaultCoordinationType() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.getCoordinationType() : DEFAULT_COORDINATION_TYPE;
}
@@ -516,8 +619,7 @@ public class EclipseLinkOrmCachingImpl
protected void setExpiry_(Integer expiry) {
Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
+ this.firePropertyChanged(EXPIRY_PROPERTY, old, this.expiry = expiry);
}
protected Integer buildExpiry() {
@@ -574,8 +676,7 @@ public class EclipseLinkOrmCachingImpl
protected void setExpiryTimeOfDay(EclipseLinkOrmTimeOfDay timeOfDay) {
EclipseLinkOrmTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
+ this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, this.expiryTimeOfDay = timeOfDay);
}
protected void syncExpiryTimeOfDay(IProgressMonitor monitor) {
@@ -610,6 +711,15 @@ public class EclipseLinkOrmCachingImpl
// ********** existence type **********
public EclipseLinkExistenceType getExistenceType() {
+ return this.existenceType;
+ }
+
+ protected void setExistenceType(EclipseLinkExistenceType type) {
+ EclipseLinkExistenceType old = this.existenceType;
+ this.firePropertyChanged(EXISTENCE_TYPE_PROPERTY, old, this.existenceType = type);
+ }
+
+ protected EclipseLinkExistenceType buildExistenceType() {
return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
}
@@ -625,8 +735,7 @@ public class EclipseLinkOrmCachingImpl
protected boolean setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- return this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
+ return this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, this.specifiedExistenceType = type);
}
protected EclipseLinkExistenceType buildSpecifiedExistenceType() {
@@ -640,8 +749,11 @@ public class EclipseLinkOrmCachingImpl
protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
+ this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, this.defaultExistenceType = type);
+ }
+
+ protected EclipseLinkExistenceType buildDefaultExistenceType() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.getExistenceType() : DEFAULT_EXISTENCE_TYPE;
}
@@ -685,6 +797,15 @@ public class EclipseLinkOrmCachingImpl
// ********** isolation **********
public EclipseLinkCacheIsolationType2_2 getIsolation() {
+ return this.isolation;
+ }
+
+ protected void setIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
+ EclipseLinkCacheIsolationType2_2 old = this.isolation;
+ this.firePropertyChanged(ISOLATION_PROPERTY, old, this.isolation = isolation);
+ }
+
+ protected EclipseLinkCacheIsolationType2_2 buildIsolation() {
return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.defaultIsolation;
}
@@ -707,8 +828,7 @@ public class EclipseLinkOrmCachingImpl
protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
+ this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, this.specifiedIsolation = isolation);
}
protected EclipseLinkCacheIsolationType2_2 buildSpecifiedIsolation() {
@@ -722,14 +842,18 @@ public class EclipseLinkOrmCachingImpl
protected void setDefaultIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
EclipseLinkCacheIsolationType2_2 old = this.defaultIsolation;
- this.defaultIsolation = isolation;
- this.firePropertyChanged(DEFAULT_ISOLATION_PROPERTY, old, isolation);
+ this.firePropertyChanged(DEFAULT_ISOLATION_PROPERTY, old, this.defaultIsolation = isolation);
+ }
+
+ protected EclipseLinkCacheIsolationType2_2 buildDefaultIsolation() {
+ return (this.javaCachingForDefaults != null) ? this.javaCachingForDefaults.getIsolation() : DEFAULT_ISOLATION;
}
+
// ********** XML cache **********
/**
- * Return null if the XML cache does not exists.
+ * Return null
if the XML cache does not exists.
*/
protected XmlCache getXmlCache() {
return this.getXmlCacheHolder().getCache();
@@ -766,6 +890,11 @@ public class EclipseLinkOrmCachingImpl
return this.parent;
}
+ @Override
+ public EclipseLinkPersistenceUnit getPersistenceUnit() {
+ return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
+ }
+
protected XmlTypeMapping getXmlTypeMapping() {
return this.getTypeMapping().getXmlTypeMapping();
}
@@ -778,15 +907,18 @@ public class EclipseLinkOrmCachingImpl
return (XmlCacheHolder) this.getXmlTypeMapping();
}
- protected EclipseLinkJavaNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected EclipseLinkJavaCaching getJavaCachingForDefaults() {
+ protected EclipseLinkJavaCaching buildJavaCachingForDefaults() {
+ if (this.getXmlCache() != null) {
+ return null; // ignore Java if the XML is present
+ }
EclipseLinkJavaNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
return (javaTypeMapping == null) ? null : javaTypeMapping.getCaching();
}
+ protected EclipseLinkJavaNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
+ return this.getTypeMapping().getJavaTypeMappingForDefaults();
+ }
+
// ********** validation **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
index be79b883c7..e666e33f57 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -47,7 +47,7 @@ public class EclipseLinkCaching
*/
@Override
protected void initializeProperties() {
- this.entities = new ArrayList();
+ this.entities = new ArrayList<>();
this.cacheTypeDefault =
this.getEnumValue(ECLIPSELINK_CACHE_TYPE_DEFAULT, EclipseLinkCacheType.values());
this.cacheSizeDefault =
@@ -178,40 +178,17 @@ public class EclipseLinkCaching
return isProperty;
}
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- @Override
- public String propertyIdOf(PersistenceUnit.Property property) {
- try {
- return super.propertyIdOf(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_CACHE_TYPE)) {
- return CACHE_TYPE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_CACHE_SIZE)) {
- return CACHE_SIZE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_SHARED_CACHE)) {
- return SHARED_CACHE_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property.toString()); //$NON-NLS-1$
- }
-
- public EclipseLinkCachingEntity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
+ public EclipseLinkCachingEntity addCachingEntity(String entityName) {
+ if (this.cachingEntityExists(entityName)) {
throw new IllegalStateException("Duplicate entity: " + entityName); //$NON-NLS-1$
}
EclipseLinkCachingEntity newEntity = this.buildEntity(entityName);
- this.addItemToList(newEntity, this.entities, ENTITIES_LIST);
+ this.addItemToList(newEntity, this.entities, CACHING_ENTITIES_LIST);
return newEntity;
}
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
+ public void removeCachingEntity(String entityName) {
+ if ( ! this.cachingEntityExists(entityName)) {
return;
}
EclipseLinkCachingEntity entity = this.getEntityNamed(entityName);
@@ -220,75 +197,69 @@ public class EclipseLinkCaching
}
// ********** CacheType **********
- public EclipseLinkCacheType getCacheTypeOf(String entityName) {
+ public EclipseLinkCacheType getEntityCacheType(String entityName) {
EclipseLinkCachingEntity entity = this.getEntityNamed(entityName);
return (entity == null) ? null : entity.getCacheType();
}
- public void setCacheTypeOf(String entityName, EclipseLinkCacheType newCacheType) {
- EclipseLinkCachingEntity old = this.setEntityCacheTypeOf(entityName, newCacheType);
+ public void setEntityCacheType(String entityName, EclipseLinkCacheType newCacheType) {
+ this.setEntityCacheTypeOf(entityName, newCacheType);
this.putEnumValue(ECLIPSELINK_CACHE_TYPE, entityName, newCacheType, false);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
}
private void cacheTypeChanged(String propertyName, String stringValue) {
String entityName = this.extractEntityNameOf(propertyName);
if( ! StringTools.isBlank(entityName)) {
- EclipseLinkCachingEntity old = this.setEntityCacheTypeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
+ this.setEntityCacheTypeOf(entityName, stringValue);
}
}
- public EclipseLinkCacheType getDefaultCacheType() {
- return (this.cacheTypeDefault == null) ? DEFAULT_CACHE_TYPE : this.cacheTypeDefault;
+ public EclipseLinkCacheType getDefaultEntityCacheType() {
+ return (this.cacheTypeDefault == null) ? DEFAULT_ENTITY_CACHE_TYPE : this.cacheTypeDefault;
}
// ********** CacheSize **********
- public Integer getCacheSizeOf(String entityName) {
+ public Integer getEntityCacheSize(String entityName) {
EclipseLinkCachingEntity entity = this.getEntityNamed(entityName);
return (entity == null) ? null : entity.getCacheSize();
}
- public void setCacheSizeOf(String entityName, Integer newCacheSize) {
- EclipseLinkCachingEntity old = this.setEntityCacheSizeOf(entityName, newCacheSize);
+ public void setEntityCacheSize(String entityName, Integer newCacheSize) {
+ this.setEntityCacheSizeOf(entityName, newCacheSize);
this.putIntegerValue(ECLIPSELINK_CACHE_SIZE + entityName, newCacheSize);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
}
private void cacheSizeChanged(String propertyName, String stringValue) {
String entityName = this.extractEntityNameOf(propertyName);
if( ! StringTools.isBlank(entityName)) {
- EclipseLinkCachingEntity old = this.setEntityCacheSizeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
+ this.setEntityCacheSizeOf(entityName, stringValue);
}
}
- public Integer getDefaultCacheSize() {
- return (this.cacheSizeDefault == null) ? DEFAULT_CACHE_SIZE : this.cacheSizeDefault;
+ public Integer getDefaultEntityCacheSize() {
+ return (this.cacheSizeDefault == null) ? DEFAULT_ENTITY_CACHE_SIZE : this.cacheSizeDefault;
}
// ********** SharedCache **********
- public Boolean getSharedCacheOf(String entityName) {
+ public Boolean getEntitySharedCache(String entityName) {
EclipseLinkCachingEntity entity = this.getEntityNamed(entityName);
return (entity == null) ? null : entity.cacheIsShared();
}
- public void setSharedCacheOf(String entityName, Boolean newSharedCache) {
- EclipseLinkCachingEntity old = this.setEntitySharedCacheOf(entityName, newSharedCache);
+ public void setEntitySharedCache(String entityName, Boolean newSharedCache) {
+ this.setEntitySharedCacheOf(entityName, newSharedCache);
this.putBooleanValue(ECLIPSELINK_SHARED_CACHE, entityName, newSharedCache, false);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
}
private void sharedCacheChanged(String propertyName, String stringValue) {
String entityName = this.extractEntityNameOf(propertyName);
if( ! StringTools.isBlank(entityName)) {
- EclipseLinkCachingEntity old = this.setEntitySharedCacheOf(entityName, stringValue);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
+ this.setEntitySharedCacheOf(entityName, stringValue);
}
}
- public Boolean getDefaultSharedCache() {
- return (this.sharedCacheDefault == null) ? DEFAULT_SHARED_CACHE : this.sharedCacheDefault;
+ public Boolean getDefaultEntitySharedCache() {
+ return (this.sharedCacheDefault == null) ? DEFAULT_ENTITY_SHARED_CACHE : this.sharedCacheDefault;
}
// ********** CacheTypeDefault **********
@@ -390,7 +361,7 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntityCacheTypeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.isBlank(stringValue)) {
+ if(( ! this.cachingEntityExists(entityName)) && StringTools.isBlank(stringValue)) {
//this is a property that is currently being added, we don't need to deal with it until the value is set
return null;
}
@@ -402,9 +373,9 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntityCacheTypeOf(String entityName, EclipseLinkCacheType cacheType) {
- EclipseLinkCachingEntity entity = (this.entityExists(entityName)) ?
+ EclipseLinkCachingEntity entity = (this.cachingEntityExists(entityName)) ?
this.getEntityNamed(entityName) :
- this.addEntity(entityName);
+ this.addCachingEntity(entityName);
return this.setEntityCacheTypeOf(entity, cacheType);
}
@@ -430,7 +401,7 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntityCacheSizeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.isBlank(stringValue)) {
+ if(( ! this.cachingEntityExists(entityName)) && StringTools.isBlank(stringValue)) {
//this is a property that is currently being added, we don't need to deal with it until the value is set
return null;
}
@@ -442,9 +413,9 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntityCacheSizeOf(String entityName, Integer size) {
- EclipseLinkCachingEntity entity = (this.entityExists(entityName)) ?
+ EclipseLinkCachingEntity entity = (this.cachingEntityExists(entityName)) ?
this.getEntityNamed(entityName) :
- this.addEntity(entityName);
+ this.addCachingEntity(entityName);
return this.setEntityCacheSizeOf(entity, size);
}
@@ -470,7 +441,7 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntitySharedCacheOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.isBlank(stringValue)) {
+ if(( ! this.cachingEntityExists(entityName)) && StringTools.isBlank(stringValue)) {
//this is a property that is currently being added, we don't need to deal with it until the value is set
return null;
}
@@ -482,9 +453,9 @@ public class EclipseLinkCaching
* Returns the old Entity
*/
private EclipseLinkCachingEntity setEntitySharedCacheOf(String entityName, Boolean sharedCache) {
- EclipseLinkCachingEntity entity = (this.entityExists(entityName)) ?
+ EclipseLinkCachingEntity entity = (this.cachingEntityExists(entityName)) ?
this.getEntityNamed(entityName) :
- this.addEntity(entityName);
+ this.addCachingEntity(entityName);
return this.setEntitySharedCacheOf(entity, sharedCache);
}
@@ -515,9 +486,9 @@ public class EclipseLinkCaching
return;
}
String entityName = entity.getName();
- this.setCacheTypeOf(entityName, null);
- this.setCacheSizeOf(entityName, null);
- this.setSharedCacheOf(entityName, null);
+ this.setEntityCacheType(entityName, null);
+ this.setEntityCacheSize(entityName, null);
+ this.setEntitySharedCache(entityName, null);
}
/**
@@ -540,13 +511,13 @@ public class EclipseLinkCaching
if(entity == null) {
throw new NullPointerException();
}
- this.removeItemFromList(entity, this.entities, ENTITIES_LIST);
+ this.removeItemFromList(entity, this.entities, CACHING_ENTITIES_LIST);
}
/**
* Return whether the Entity exist.
*/
- public boolean entityExists(String name) {
+ public boolean cachingEntityExists(String name) {
for(EclipseLinkCachingEntity entity: this.entities) {
if(entity.getName().equals(name)) {
return true;
@@ -566,15 +537,15 @@ public class EclipseLinkCaching
// ****** entities list *******
- public ListIterable getEntities() {
+ public ListIterable getCachingEntities() {
return IterableTools.cloneLive(this.entities);
}
- public Iterable getEntityNames() {
- return IterableTools.transform(this.getEntities(), EclipseLinkCachingEntity.NAME_TRANSFORMER);
+ public Iterable getCachingEntityNames() {
+ return IterableTools.transform(this.getCachingEntities(), EclipseLinkCachingEntity.NAME_TRANSFORMER);
}
- public int getEntitiesSize() {
+ public int getCachingEntitiesSize() {
return this.entities.size();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptionsImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptionsImpl.java
index fc73b417b5..f479045a71 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptionsImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptionsImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -147,7 +147,7 @@ public class EclipseLinkOptionsImpl
SESSIONS_XML_PROPERTY);
propertyNames.put(
ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES,
- SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY);
+ INCLUDE_DESCRIPTOR_QUERIES_PROPERTY);
propertyNames.put(
ECLIPSELINK_TARGET_DATABASE,
TARGET_DATABASE_PROPERTY);
@@ -215,8 +215,8 @@ public class EclipseLinkOptionsImpl
public void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries) {
Boolean old = this.includeDescriptorQueries;
this.includeDescriptorQueries = newIncludeDescriptorQueries;
- this.putProperty(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, newIncludeDescriptorQueries);
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newIncludeDescriptorQueries);
+ this.putProperty(INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, newIncludeDescriptorQueries);
+ this.firePropertyChanged(INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newIncludeDescriptorQueries);
}
private void includeDescriptorQueriesChanged(String stringValue) {
@@ -224,7 +224,7 @@ public class EclipseLinkOptionsImpl
Boolean old = this.includeDescriptorQueries;
this.includeDescriptorQueries = newValue;
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newValue);
+ this.firePropertyChanged(INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newValue);
}
public Boolean getDefaultIncludeDescriptorQueries() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToManyMappingComposite.java
index b7d9ba1689..bebd51c5a5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToManyMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToManyMappingComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,12 +11,14 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.Cascade;
import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
@@ -46,6 +48,7 @@ public abstract class EclipseLinkAbstractManyToManyMappingComposite buildJoinFetchModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return this.subject.getJoinFetch();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkJoinFetchMapping.JOIN_FETCH_TRANSFORMER);
}
protected void initializeConvertersCollapsibleSection(Composite container) {
@@ -99,12 +97,6 @@ public abstract class EclipseLinkAbstractManyToManyMappingComposite buildConverterContainerModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return this.subject.getConverterContainer();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkConvertibleMapping.CONVERTER_CONTAINER_TRANSFORMER);
}
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToOneMappingComposite.java
index 234e7667e3..d94af79905 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToOneMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractManyToOneMappingComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,11 +11,12 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.Cascade;
import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToOneMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
@@ -73,6 +74,7 @@ public abstract class EclipseLinkAbstractManyToOneMappingComposite buildJoinFetchModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return this.subject.getJoinFetch();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkJoinFetchMapping.JOIN_FETCH_TRANSFORMER);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToManyMappingComposite.java
index e4a5d8198d..e3e91c9641 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToManyMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToManyMappingComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,14 +11,17 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.Cascade;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwnedMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite;
@@ -47,6 +50,7 @@ public abstract class EclipseLinkAbstractOneToManyMappingComposite buildPrivateOwnedModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return this.subject.getPrivateOwned();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkPrivateOwnedMapping.PRIVATE_OWNED_TRANSFORMER);
}
protected PropertyValueModel buildJoinFetchModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return this.subject.getJoinFetch();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkJoinFetchMapping.JOIN_FETCH_TRANSFORMER);
}
protected void initializeConvertersCollapsibleSection(Composite container) {
@@ -120,11 +115,6 @@ public abstract class EclipseLinkAbstractOneToManyMappingComposite buildConverterHolderValueModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return this.subject.getConverterContainer();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkConvertibleMapping.CONVERTER_CONTAINER_TRANSFORMER);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToOneMappingComposite.java
index 438f786a68..5b80a0a1a5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToOneMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAbstractOneToOneMappingComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,13 +11,15 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.Cascade;
import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwnedMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingComposite;
@@ -44,6 +46,7 @@ public abstract class EclipseLinkAbstractOneToOneMappingComposite buildJoinFetchModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return this.subject.getJoinFetch();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkJoinFetchMapping.JOIN_FETCH_TRANSFORMER);
}
protected PropertyValueModel buildPrivateOwnedModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return this.subject.getPrivateOwned();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkPrivateOwnedMapping.PRIVATE_OWNED_TRANSFORMER);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
index 1964be8802..3ed7ed9d70 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
@@ -21,7 +20,9 @@ import org.eclipse.jpt.jpa.core.context.LobConverter;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutableMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingComposite;
@@ -50,8 +51,8 @@ public abstract class EclipseLinkBasicMappingComposite buildMutableModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return this.subject.getMutable();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkMutableMapping.MUTABLE_TRANSFORMER);
}
protected PropertyValueModel buildEclipseLinkConvertModel(PropertyValueModel converterModel) {
@@ -140,11 +136,6 @@ public abstract class EclipseLinkBasicMappingComposite buildConverterContainerModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return this.subject.getConverterContainer();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkConvertibleMapping.CONVERTER_CONTAINER_TRANSFORMER);
}
}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeCombo.java
index b8758d2dea..11dd4d11b7 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeCombo.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeCombo.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
import org.eclipse.swt.widgets.Composite;
@@ -55,26 +55,20 @@ public class EclipseLinkCacheSizeCombo
@Override
protected PropertyValueModel buildDefaultModel() {
- return new PropertyAspectAdapterXXXX(this.getSubjectHolder(), EclipseLinkCaching.DEFAULT_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultSize());
- }
- };
+ return PropertyValueModelTools.modelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.DEFAULT_SIZE_PROPERTY,
+ EclipseLinkCaching.DEFAULT_SIZE_TRANSFORMER
+ );
}
@Override
protected ModifiablePropertyValueModel buildSelectedItemModel() {
- return new PropertyAspectAdapterXXXX(this.getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedSize();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setSpecifiedSize(value);
- }
- };
+ return PropertyValueModelTools.modifiableModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_SIZE_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_SIZE_TRANSFORMER,
+ EclipseLinkCaching.SET_SPECIFIED_SIZE_CLOSURE
+ );
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
index e6a2b253df..e99c2df8c3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
@@ -24,7 +24,8 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLinkJavaEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelAdapter;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -179,75 +180,55 @@ public abstract class EclipseLinkCachingComposite
protected abstract void initializeExistenceCheckingComposite(Composite container);
private PropertyValueModel buildSharedCacheEnabler() {
- return new PropertyAspectAdapterXXXX(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isShared());
- }
- };
+ return PropertyValueModelTools.modelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SHARED_PROPERTY,
+ EclipseLinkCaching.SHARED_PREDICATE
+ );
}
private ModifiablePropertyValueModel buildSpecifiedSharedModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedShared();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedShared(value);
- }
- };
+ return PropertyValueModelTools.modifiableModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_SHARED_TRANSFORMER,
+ EclipseLinkCaching.SET_SPECIFIED_SHARED_CLOSURE
+ );
}
private PropertyValueModel buildSharedStringModel() {
return PropertyValueModelTools.transform_(this.buildDefaultSharedModel(), SHARED_TRANSFORMER);
}
- private static final Transformer SHARED_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer SHARED_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CACHING_COMPOSITE_SHARED_LABEL_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CACHING_COMPOSITE_SHARED_LABEL
);
private PropertyValueModel buildDefaultSharedModel() {
- return new PropertyAspectAdapterXXXX(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedShared() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultShared());
- }
- };
+ return TriStateCheckBoxLabelModelAdapter.propertyValueModel(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_SHARED_TRANSFORMER,
+ EclipseLinkCaching.DEFAULT_SHARED_PROPERTY,
+ EclipseLinkCaching.DEFAULT_SHARED_PREDICATE
+ );
}
private ModifiablePropertyValueModel buildAlwaysRefreshModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedAlwaysRefresh();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedAlwaysRefresh(value);
- }
- };
+ return PropertyValueModelTools.modifiableModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_TRANSFORMER,
+ EclipseLinkCaching.SET_SPECIFIED_ALWAYS_REFRESH_CLOSURE
+ );
}
private PropertyValueModel buildAlwaysRefreshStringModel() {
return PropertyValueModelTools.transform_(this.buildDefaultAlwaysRefreshModel(), ALWAYS_REFRESH_TRANSFORMER);
}
- private static final Transformer ALWAYS_REFRESH_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer ALWAYS_REFRESH_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_ALWAYS_REFRESH_COMPOSITE_ALWAYS_REFRESH_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_ALWAYS_REFRESH_COMPOSITE_ALWAYS_REFRESH_LABEL
);
@@ -263,30 +244,25 @@ public abstract class EclipseLinkCachingComposite
if (this.subject.getSpecifiedAlwaysRefresh() != null) {
return null;
}
- return Boolean.valueOf(this.subject.isDefaultAlwaysRefresh());
+ return Boolean.valueOf(this.subject.getDefaultAlwaysRefresh());
}
};
}
private ModifiablePropertyValueModel buildRefreshOnlyIfNewerModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedRefreshOnlyIfNewer();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedRefreshOnlyIfNewer(value);
- }
- };
+ return PropertyValueModelTools.modifiableModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_TRANSFORMER,
+ EclipseLinkCaching.SET_SPECIFIED_REFRESH_ONLY_IF_NEWER_CLOSURE
+ );
}
private PropertyValueModel buildRefreshOnlyIfNewerStringModel() {
return PropertyValueModelTools.transform_(this.buildDefaultRefreshOnlyIfNewerModel(), REFRESH_ONLY_IF_NEWER_TRANSFORMER);
}
- private static final Transformer REFRESH_ONLY_IF_NEWER_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer REFRESH_ONLY_IF_NEWER_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_REFRESH_ONLY_IF_NEWER_COMPOSITE_REFRESH_ONLY_IF_NEWER_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_REFRESH_ONLY_IF_NEWER_COMPOSITE_REFRESH_ONLY_IF_NEWER_LABEL
);
@@ -302,29 +278,24 @@ public abstract class EclipseLinkCachingComposite
if (this.subject.getSpecifiedRefreshOnlyIfNewer() != null) {
return null;
}
- return Boolean.valueOf(this.subject.isDefaultRefreshOnlyIfNewer());
+ return Boolean.valueOf(this.subject.getDefaultRefreshOnlyIfNewer());
}
};
}
private ModifiablePropertyValueModel buildDisableHitsModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedDisableHits();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedDisableHits(value);
- }
- };
+ return PropertyValueModelTools.modifiableModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY,
+ EclipseLinkCaching.SPECIFIED_DISABLE_HITS_TRANSFORMER,
+ EclipseLinkCaching.SET_SPECIFIED_DISABLE_HITS_CLOSURE
+ );
}
private PropertyValueModel buildDisableHitsStringModel() {
return PropertyValueModelTools.transform_(this.buildDefaultDisableHitsModel(), DISABLE_HITS_TRANSFORMER);
}
- private static final Transformer DISABLE_HITS_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer DISABLE_HITS_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_DISABLE_HITS_COMPOSITE_DISABLE_HITS_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_DISABLE_HITS_COMPOSITE_DISABLE_HITS_LABEL
);
@@ -340,7 +311,7 @@ public abstract class EclipseLinkCachingComposite
if (this.subject.getSpecifiedDisableHits() != null) {
return null;
}
- return Boolean.valueOf(this.subject.isDefaultDisableHits());
+ return Boolean.valueOf(this.subject.getDefaultDisableHits());
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
index 7d9fc3b6d9..b4a96a732f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
@@ -21,7 +21,7 @@ import org.eclipse.jpt.jpa.core.jpa2.context.CacheableReference2_0;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLinkJavaEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
import org.eclipse.jpt.jpa.ui.jpa2.details.JptJpaUiDetailsMessages2_0;
import org.eclipse.swt.layout.GridData;
@@ -163,7 +163,7 @@ public abstract class EclipseLinkCachingComposite2_0 CACHEABLE_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer CACHEABLE_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaUiDetailsMessages2_0.ENTITY_CACHEABLE_WITH_DEFAULT_LABEL,
JptJpaUiDetailsMessages2_0.ENTITY_CACHEABLE_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
index 7c21f2a7ee..79e76fbe0d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
@@ -20,6 +20,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutableMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite;
@@ -104,12 +105,7 @@ public abstract class EclipseLinkIdMappingComposite buildMutableModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return this.subject.getMutable();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkMutableMapping.MUTABLE_TRANSFORMER);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java
index 53bc03dfd4..679f351ccc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java
@@ -35,7 +35,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFacto
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTenantDiscriminatorColumnsComposite.TenantDiscriminatorColumnsEditor;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
@@ -204,7 +204,7 @@ public class EclipseLinkMultitenancyComposite
return PropertyValueModelTools.transform_(this.buildDefaultIncludeCriteriaModel(), INCLUDE_CRITERIA_TRANSFORMER);
}
- private static final Transformer INCLUDE_CRITERIA_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer INCLUDE_CRITERIA_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_MULTITENANCY_COMPOSITE_INCLUDE_CRITERIA_WITH_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_MULTITENANCY_COMPOSITE_INCLUDE_CRITERIA
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableTriStateCheckBox.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableTriStateCheckBox.java
index 18a998fce0..32fee2fb24 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableTriStateCheckBox.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableTriStateCheckBox.java
@@ -18,7 +18,7 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -89,7 +89,7 @@ public class EclipseLinkMutableTriStateCheckBox
return PropertyValueModelTools.transform_(this.buildDefaultMutableModel(), MUTABLE_TRANSFORMER);
}
- private static final Transformer MUTABLE_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer MUTABLE_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_MUTABLE_COMPOSITE_MUTABLE_LABEL_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_MUTABLE_COMPOSITE_MUTABLE_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyTriStateCheckBox.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyTriStateCheckBox.java
index 08de21e637..ebbde1c17d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyTriStateCheckBox.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyTriStateCheckBox.java
@@ -18,7 +18,7 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -90,7 +90,7 @@ public class EclipseLinkReadOnlyTriStateCheckBox
return PropertyValueModelTools.transform_(this.buildDefaultReadOnlyModel(), READ_ONLY_TRANSFORMER);
}
- private static final Transformer READ_ONLY_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer READ_ONLY_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_READ_ONLY_COMPOSITE_READ_ONLY_WITH_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_READ_ONLY_COMPOSITE_READ_ONLY_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnComposite.java
index c32a9c1203..dc89d0b61f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnComposite.java
@@ -37,7 +37,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFacto
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
import org.eclipse.jpt.jpa.ui.internal.details.db.DatabaseObjectCombo;
import org.eclipse.osgi.util.NLS;
@@ -411,7 +411,7 @@ public class EclipseLinkTenantDiscriminatorColumnComposite
return PropertyValueModelTools.transform_(this.buildDefaultPrimaryKeyModel(), PRIMARY_KEY_TRANSFORMER);
}
- private static final Transformer PRIMARY_KEY_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer PRIMARY_KEY_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiDetailsMessages.TENANT_DISCRIMINATOR_COLUMN_COMPOSITE_PRIMARY_KEY_WITH_DEFAULT,
JptJpaEclipseLinkUiDetailsMessages.TENANT_DISCRIMINATOR_COLUMN_COMPOSITE_PRIMARY_KEY
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
index dab64e6960..b583fe79bc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
@@ -19,6 +19,7 @@ import org.eclipse.jpt.jpa.core.context.Converter;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
+import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutableMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
@@ -125,12 +126,7 @@ public abstract class EclipseLinkVersionMappingComposite buildMutableModel() {
- return new PropertyAspectAdapterXXXX(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return this.subject.getMutable();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), EclipseLinkMutableMapping.MUTABLE_TRANSFORMER);
}
protected void initializeConvertersCollapsibleSection(Composite container) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkLoggingComposite2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkLoggingComposite2_0.java
index b494e51fc5..12c7672f71 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkLoggingComposite2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkLoggingComposite2_0.java
@@ -22,7 +22,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkLoggi
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkLoggingLevel;
import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.EclipseLinkLoggingComposite;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -156,7 +156,7 @@ public class EclipseLinkLoggingComposite2_0
return PropertyValueModelTools.transform_(this.buildDefaultConnectionModel(), CONNECTION_TRANSFORMER);
}
- private static final Transformer CONNECTION_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer CONNECTION_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_LOGGING_TAB_CONNECTION_LABEL_DEFAULT,
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_LOGGING_TAB_CONNECTION_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCacheDefaultsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCacheDefaultsComposite.java
index 1efd2c12ba..a96b8b9383 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCacheDefaultsComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCacheDefaultsComposite.java
@@ -23,7 +23,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCache
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCaching;
import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -189,7 +189,7 @@ public class EclipseLinkCacheDefaultsComposite
return PropertyValueModelTools.transform_(this.buildDefaultDefaultSharedCacheModel(), DEFAULT_SHARED_CACHE_TRANSFORMER);
}
- private static final Transformer DEFAULT_SHARED_CACHE_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer DEFAULT_SHARED_CACHE_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_CACHING_TAB_DEFAULT_SHARED_CACHE_DEFAULT_LABEL,
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_CACHING_TAB_SHARED_CACHE_DEFAULT_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityCachingPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityCachingPropertyComposite.java
index 0f89ff1895..c6aab0d9dd 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityCachingPropertyComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityCachingPropertyComposite.java
@@ -32,7 +32,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCachi
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCachingEntity;
import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -131,7 +131,7 @@ public class EclipseLinkEntityCachingPropertyComposite
@Override
protected EclipseLinkCacheType getDefaultValue() {
- return getSubjectParent().getDefaultCacheType();
+ return getSubjectParent().getDefaultEntityCacheType();
}
@Override
@@ -163,7 +163,7 @@ public class EclipseLinkEntityCachingPropertyComposite
@Override
protected EclipseLinkCacheType getValue() {
- return getSubjectParent().getCacheTypeOf(getSubjectName());
+ return getSubjectParent().getEntityCacheType(getSubjectName());
}
@Override
@@ -181,7 +181,7 @@ public class EclipseLinkEntityCachingPropertyComposite
@Override
protected void setValue(EclipseLinkCacheType value) {
- getSubjectParent().setCacheTypeOf(getSubjectName(), value);
+ getSubjectParent().setEntityCacheType(getSubjectName(), value);
}
@Override
@@ -239,12 +239,12 @@ public class EclipseLinkEntityCachingPropertyComposite
return new PropertyAspectAdapterXXXX(getSubjectHolder(), EclipseLinkCachingEntity.CACHE_SIZE_PROPERTY) {
@Override
protected Integer buildValue_() {
- return getSubjectParent().getCacheSizeOf(getSubjectName());
+ return getSubjectParent().getEntityCacheSize(getSubjectName());
}
@Override
protected void setValue_(Integer value) {
- getSubjectParent().setCacheSizeOf(getSubjectName(), value);
+ getSubjectParent().setEntityCacheSize(getSubjectName(), value);
}
};
}
@@ -259,12 +259,12 @@ public class EclipseLinkEntityCachingPropertyComposite
getSubjectHolder(), EclipseLinkCachingEntity.SHARED_CACHE_PROPERTY) {
@Override
protected Boolean buildValue_() {
- return getSubjectParent().getSharedCacheOf(getSubjectName());
+ return getSubjectParent().getEntitySharedCache(getSubjectName());
}
@Override
protected void setValue_(Boolean value) {
- getSubjectParent().setSharedCacheOf(getSubjectName(), value);
+ getSubjectParent().setEntitySharedCache(getSubjectName(), value);
}
};
}
@@ -273,7 +273,7 @@ public class EclipseLinkEntityCachingPropertyComposite
return PropertyValueModelTools.transform_(this.buildDefaultAndNonDefaultSharedCacheModel(), SHARED_CACHE_TRANSFORMER);
}
- private static final Transformer SHARED_CACHE_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer SHARED_CACHE_TRANSFORMER = new TriStateCheckBoxLabelModelStringTransformer(
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_CACHING_TAB_DEFAULT_SHARED_CACHE_LABEL,
JptJpaEclipseLinkUiMessages.PERSISTENCE_XML_CACHING_TAB_SHARED_CACHE_LABEL
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityListComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityListComposite.java
index a6145985ff..790f3aeca3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityListComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkEntityListComposite.java
@@ -117,7 +117,7 @@ public class EclipseLinkEntityListComposite
public void removeSelectedItems(CollectionValueModel selectedItemsModel) {
//assume only 1 item since remove button is disabled otherwise
EclipseLinkCachingEntity cachingEntity = selectedItemsModel.iterator().next();
- getSubject().removeEntity(cachingEntity.getName());
+ getSubject().removeCachingEntity(cachingEntity.getName());
}
};
}
@@ -132,8 +132,8 @@ public class EclipseLinkEntityListComposite
entityName = type.getElementName();
}
- if( ! this.getSubject().entityExists(entityName)) {
- return this.getSubject().addEntity(entityName);
+ if( ! this.getSubject().cachingEntityExists(entityName)) {
+ return this.getSubject().addCachingEntity(entityName);
}
}
return null;
@@ -183,14 +183,14 @@ public class EclipseLinkEntityListComposite
private ListValueModel buildEntitiesListModel() {
return new ListAspectAdapter(
- this.getSubjectHolder(), EclipseLinkCaching.ENTITIES_LIST) {
+ this.getSubjectHolder(), EclipseLinkCaching.CACHING_ENTITIES_LIST) {
@Override
protected ListIterable getListIterable() {
- return this.subject.getEntities();
+ return this.subject.getCachingEntities();
}
@Override
protected int size_() {
- return this.subject.getEntitiesSize();
+ return this.subject.getCachingEntitiesSize();
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkJdbcConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkJdbcConnectionPropertiesComposite.java
index 6ef81ae7a5..995ea9c054 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkJdbcConnectionPropertiesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkJdbcConnectionPropertiesComposite.java
@@ -38,7 +38,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkConne
import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiMessages;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.plugin.JptJpaEclipseLinkUiPlugin;
import org.eclipse.jpt.jpa.ui.JpaWorkbench;
-import org.eclipse.jpt.jpa.ui.internal.BooleanStringTransformer;
+import org.eclipse.jpt.jpa.ui.internal.TriStateCheckBoxLabelModelStringTransformer;
import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
import org.eclipse.jpt.jpa.ui.jpa2.persistence.JptJpaUiPersistenceMessages2_0;
import org.eclipse.swt.graphics.Image;
@@ -234,7 +234,7 @@ public class EclipseLinkJdbcConnectionPropertiesComposite BIND_PARAMETERS_TRANSFORMER = new BooleanStringTransformer(
+ private static final Transformer