blob: 4bb3228f0ad4abb3127071d7db034e74e5eb63e5 [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.jpt2_0.core.internal.platform;
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.JpaValidation;
import org.eclipse.jpt.core.internal.platform.GenericJpaAnnotationProvider;
import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
import org.eclipse.jpt.core.internal.platform.GenericJpaPlatformProvider;
/**
* All the state in the JPA platform should be "static" (i.e. unchanging once
* it is initialized).
*/
public class Generic2_0JpaPlatformFactory
implements JpaPlatformFactory
{
/**
* zero-argument constructor
*/
public Generic2_0JpaPlatformFactory() {
super();
}
public JpaPlatform buildJpaPlatform(String id) {
return new GenericJpaPlatform(
id,
buildJpaFactory(),
buildJpaAnnotationProvider(),
buildJpaValidation(),
GenericJpaPlatformProvider.instance(),
Generic2_0JpaPlatformProvider.instance());
}
protected JpaFactory buildJpaFactory() {
return new Generic2_0JpaFactory();
}
protected JpaAnnotationProvider buildJpaAnnotationProvider() {
return new GenericJpaAnnotationProvider(
Generic2_0JpaAnnotationDefinitionProvider.instance());
}
protected JpaValidation buildJpaValidation() {
return new JpaValidation() {
//table_per_class inheritance support is optional in the 2.0 spec
public Supported getTablePerConcreteClassInheritanceIsSupported() {
return Supported.MAYBE;
}
};
}
}