blob: ae3fbd0cf91235b9616c5191dc80f5ce7a8ba437 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 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.core.internal.platform;
import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
import org.eclipse.jpt.core.JpaAnnotationProvider;
import org.eclipse.jpt.core.JpaFactory;
import org.eclipse.jpt.core.JpaPlatform;
import org.eclipse.jpt.core.JpaPlatformFactory;
import org.eclipse.jpt.core.JpaPlatformProvider;
import org.eclipse.jpt.core.JpaValidation;
/**
* All the state in the JPA platform should be "static" (i.e. unchanging once
* it is initialized).
*/
public class GenericJpaPlatformFactory
implements JpaPlatformFactory
{
/**
* zero-argument constructor
*/
public GenericJpaPlatformFactory() {
super();
}
public JpaPlatform buildJpaPlatform(String id) {
return new GenericJpaPlatform(
id,
this.buildJpaFactory(),
this.buildJpaAnnotationProvider(),
this.buildJpaValidation(),
this.platformProviders());
}
protected JpaFactory buildJpaFactory() {
return new GenericJpaFactory();
}
protected JpaAnnotationProvider buildJpaAnnotationProvider() {
return new GenericJpaAnnotationProvider(this.annotationDefinitionProvider());
}
protected JpaPlatformProvider[] platformProviders() {
JpaPlatformProvider[] platformProviders = {
GenericJpaPlatformProvider.instance()
};
return platformProviders;
}
protected JpaAnnotationDefinitionProvider annotationDefinitionProvider() {
return GenericJpaAnnotationDefinitionProvider.instance();
}
protected JpaValidation buildJpaValidation() {
return new JpaValidation() {
public Supported getTablePerConcreteClassInheritanceIsSupported() {
return Supported.MAYBE;
}
};
}
}