blob: c43844d42d6bfe3f3774c14aab5d099ae2c6916d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008, 2010 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.orm;
import java.util.List;
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBasicMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public class OrmEclipseLinkBasicMapping
extends AbstractOrmBasicMapping<XmlBasic>
implements EclipseLinkBasicMapping
{
protected final OrmEclipseLinkMutable mutable;
public OrmEclipseLinkBasicMapping(OrmPersistentAttribute parent, XmlBasic xmlMapping) {
super(parent, xmlMapping);
this.mutable = new OrmEclipseLinkMutable(this);
}
// ********** synchronize/update **********
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
this.mutable.synchronizeWithResourceModel();
}
@Override
public void update() {
super.update();
this.mutable.update();
}
// ********** mutable **********
public EclipseLinkMutable getMutable() {
return this.mutable;
}
// ********** converter adapters **********
/**
* put the EclipseLink convert adapter first - this is the order EclipseLink searches
*/
@Override
protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
return new CompositeIterable<OrmConverter.Adapter>(
OrmEclipseLinkConvert.Adapter.instance(),
super.getConverterAdapters()
);
}
// ********** validation **********
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
// TODO mutable validation
}
}