blob: 6a0db9b94ae3c6da6dd555ec34ccf2e719e51109 (
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 (c) 2009, 2011 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.core.internal.jpa2;
import org.eclipse.jpt.jpa.core.JpaFacet;
import org.eclipse.jpt.jpa.core.JpaPlatform;
import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
/**
* 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,
this.buildJpaVersion(),
new GenericJpaFactory2_0(),
new JpaAnnotationProvider(Generic2_0JpaAnnotationDefinitionProvider.instance()),
Generic2_0JpaPlatformProvider.instance(),
this.buildJpaPlatformVariation());
}
private JpaPlatform.Version buildJpaVersion() {
return new SimpleVersion(JpaFacet.VERSION_2_0.getVersionString());
}
protected JpaPlatformVariation buildJpaPlatformVariation() {
return new JpaPlatformVariation() {
//table_per_class inheritance support is optional in the 2.0 spec
public Supported getTablePerConcreteClassInheritanceIsSupported() {
return Supported.MAYBE;
}
public boolean isJoinTableOverridable() {
return true;
}
};
}
}
|