Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java40
1 files changed, 31 insertions, 9 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java
index 288b32074e..2c7d97f16d 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.eclipselink.core.internal.context.orm;
+import java.util.List;
import org.eclipse.jpt.core.context.orm.OrmPersistentType;
import org.eclipse.jpt.core.internal.context.orm.GenericOrmEntity;
import org.eclipse.jpt.core.resource.orm.XmlEntity;
@@ -18,20 +19,25 @@ import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
import org.eclipse.jpt.eclipselink.core.context.Customizer;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
+import org.eclipse.jpt.eclipselink.core.context.java.JavaCustomizer;
import org.eclipse.jpt.eclipselink.core.context.java.JavaReadOnly;
import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
+import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
public class EclipseLinkOrmEntity extends GenericOrmEntity
implements EclipseLinkEntity
{
protected final EclipseLinkOrmReadOnly readOnly;
+ protected final EclipseLinkOrmCustomizer customizer;
public EclipseLinkOrmEntity(OrmPersistentType parent) {
super(parent);
this.readOnly = getJpaFactory().buildOrmReadOnly(this);
+ this.customizer = getJpaFactory().buildOrmCustomizer(this);
}
@@ -51,12 +57,11 @@ public class EclipseLinkOrmEntity extends GenericOrmEntity
}
public Customizer getCustomizer() {
- // TODO Auto-generated method stub
- return null;
+ return this.customizer;
}
public EclipseLinkOrmReadOnly getReadOnly() {
- return readOnly;
+ return this.readOnly;
}
@@ -72,23 +77,40 @@ public class EclipseLinkOrmEntity extends GenericOrmEntity
@Override
public void initialize(XmlEntity entity) {
- super.initialize(entity);
- getReadOnly().initialize((XmlReadOnly) entity, getJavaReadOnly());
+ super.initialize(entity);
+ this.readOnly.initialize((XmlReadOnly) entity, getJavaReadOnly());
+ this.customizer.initialize((XmlCustomizerHolder) entity, getJavaCustomizer());
}
@Override
public void update(XmlEntity entity) {
super.update(entity);
- getReadOnly().update((XmlReadOnly) entity, getJavaReadOnly());
+ this.readOnly.update((XmlReadOnly) entity, getJavaReadOnly());
+ this.customizer.update((XmlCustomizerHolder) entity, getJavaCustomizer());
}
@Override
- public EclipseLinkJavaEntity getJavaEntity() {
- return (EclipseLinkJavaEntity) super.getJavaEntity();
+ protected EclipseLinkJavaEntity getJavaEntityForDefaults() {
+ return (EclipseLinkJavaEntity) super.getJavaEntityForDefaults();
}
protected JavaReadOnly getJavaReadOnly() {
- EclipseLinkJavaEntity javaEntity = getJavaEntity();
+ EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
return (javaEntity == null) ? null : javaEntity.getReadOnly();
}
+
+ protected JavaCustomizer getJavaCustomizer() {
+ EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
+ return (javaEntity == null) ? null : javaEntity.getCustomizer();
+ }
+
+
+ // **************** validation **************************************
+
+ @Override
+ public void validate(List<IMessage> messages) {
+ super.validate(messages);
+ this.readOnly.validate(messages);
+ this.customizer.validate(messages);
+ }
}

Back to the top