blob: 017f7c0f9230acab369047eea7d9b278a312f69d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011, 2012 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.internal.context.java;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddedMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
public class JavaEclipseLinkEmbeddedMapping
extends AbstractJavaEmbeddedMapping
implements EclipseLinkJavaConvertibleMapping
{
protected final JavaEclipseLinkConverterContainer converterContainer;
public JavaEclipseLinkEmbeddedMapping(JavaPersistentAttribute parent) {
super(parent);
this.converterContainer = this.buildConverterContainer();
}
// ********** synchronize/update **********
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
this.converterContainer.synchronizeWithResourceModel();
}
@Override
public void update() {
super.update();
this.converterContainer.update();
}
// ********** converters **********
public JavaEclipseLinkConverterContainer getConverterContainer() {
return this.converterContainer;
}
protected JavaEclipseLinkConverterContainer buildConverterContainer() {
return new JavaEclipseLinkConverterContainerImpl(this);
}
// ********** converter container parent adapter **********
public JavaJpaContextNode getConverterContainerParent() {
return this; // no adapter
}
public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
return this.getResourceAttribute();
}
public boolean parentSupportsConverters() {
return ! this.getPersistentAttribute().isVirtual();
}
}