| /******************************************************************************* |
| * Copyright (c) 2010, 2013 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License 2.0, which accompanies this distribution |
| * and is available at https://www.eclipse.org/legal/epl-2.0/. |
| * |
| * Contributors: |
| * Oracle - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; |
| |
| import java.util.ArrayList; |
| |
| import org.eclipse.jpt.common.core.JptResourceType; |
| import org.eclipse.jpt.common.utility.internal.collection.CollectionTools; |
| import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition; |
| import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextModelFactory; |
| import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition; |
| import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings; |
| import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; |
| |
| public class EclipseLinkOrmXmlDefinition2_2 |
| extends EclipseLinkAbstractOrmXmlDefinition |
| { |
| // singleton |
| private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXmlDefinition2_2(); |
| |
| |
| /** |
| * Return the singleton. |
| */ |
| public static OrmXmlDefinition instance() { |
| return INSTANCE; |
| } |
| |
| |
| /** |
| * Enforce singleton usage |
| */ |
| private EclipseLinkOrmXmlDefinition2_2() { |
| super(); |
| } |
| |
| |
| @Override |
| protected OrmXmlContextModelFactory buildContextModelFactory() { |
| return EclipseLinkOrmXmlDefinition2_1.instance().getContextModelFactory(); |
| } |
| |
| public JptResourceType getResourceType() { |
| return this.getResourceType(XmlEntityMappings.CONTENT_TYPE, EclipseLink2_2.SCHEMA_VERSION); |
| } |
| |
| @Override |
| protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) { |
| CollectionTools.addAll(definitions, EclipseLinkOrmXmlDefinition2_0.ECLIPSELINK_2_0_ATTRIBUTE_MAPPING_DEFINITIONS); |
| } |
| } |