Skip to main content
summaryrefslogtreecommitdiffstats
blob: a40ebc2138f4feab53142c4396b60d181a48ec9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
 * <copyright>
 *
 * Copyright (c) 2005, 2006, 2007 Springsite BV (The Netherlands) and others
 * 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:
 *   Douglas Bitting
 * </copyright>
 *
 * $Id: MappingBuilder.java,v 1.3 2007/02/01 12:35:55 mtaal Exp $
 */
package org.eclipse.emf.teneo.hibernate.hbannotation.util;

import org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator;
import org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder;
import org.eclipse.emf.teneo.annotations.pamodel.util.BasicPamodelBuilder;
import org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter;
import org.eclipse.emf.teneo.annotations.xml.XmlPersistenceMapper;

/**
 * This class simply provides the Hibernate-equivalent builders to the
 * generic Elver annotation processing mechanism.
 */
public class MappingBuilder extends PersistenceMappingBuilder {

	public static final MappingBuilder INSTANCE = new MappingBuilder();

	protected BasicPamodelBuilder getModelBuilder() {
		return new HbAnnotationModelBuilder();
	}

	protected DefaultAnnotator getDefaultAnnotator() {
		return new HibernateDefaultAnnotator();
	}
	
	/** Return a java annotation parser */
	protected EAnnotationParserImporter getEAnnotationParserImporter() {
		return new HbEAnnotationParserImporter();
	}

	/** Overridden to use the local schema */
	protected XmlPersistenceMapper getXmlPersistenceMapper() {
		return new LocalXmlPersistenceMapper();
	}

	/** Overridden to make use of another schema */
	private class LocalXmlPersistenceMapper extends XmlPersistenceMapper {
		// nothing here because is not needed
		
		/** Return the hb prefix */
		protected String getPrefix() {
			return "hb";
		}

	}
}

Back to the top