我需要帮助,这似乎非常相似,这对下一个问题一个.但是,建议的解决方案在我的情况下不起作用.我有一个被标记为@Embbedable的类RoadDistance和一个RoadMetricLoader类,它也是@Embbedable,它包含两个类型为RoadDistante的属性.还有类RoadConnection,它是一个实体,包含RoadmetricLoader类型的属性.我没有成功覆盖RoadMeistanceLoader的RoadMetricLoader属性(@AttributeOverride)(我没有在表ROAD_CONNECTION中获得ROAD_ESTIMATED_DISTANCE_VALUE,ROAD_ESTIMATED_DISTANCE_UNIT_ID,ROAD_REAL_DISTANCE_VALUE和ROAD_REAL_DISTANCE_UNIT_ID字段)
数据库是MySQL 5.2.21,用于JPA 2.0的库是EclipseLink 2.4.1中的库
我尝试了不同的选项,但没有一个可行.我在下面的代码中显示了注释块中的所有选项.取消注释时,一个选项会保留其他选项.这些是我在每种情况下得到的结果:
选项1:它不会返回任何错误,但在表ROAD_CONNECTION中我只得到两个错误:VALUE和UNIT_ID.
方案2:与选项1相同的结果.
选项3:这是我的第一个赌注(参见官方文档示例2,以及上面已经指出的链接)但是我得到了下一个错误
Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@138d107f
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [jamUnit] failed.
Internal Exception: Exception [EclipseLink-7309] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The attribute named [estimatedRoadDistance.unit] from the embeddable class [class …Run Code Online (Sandbox Code Playgroud) 下一个类是红色三角形的视图:
public class FreeStyleViewII extends View {
private final Paint paint = new Paint();
private final int[] colors = new int[] {
Color.RED,
Color.RED,
Color.RED,
0xFF000000, 0xFF000000, 0xFF000000
};
private final float[] verts = new float[] {
1f/2f * 200f, 1f/4f * 200f,
1f/4f * 200f, 3f/4f * 200f,
3f/4f * 200f, 3f/4f * 200f
};
private final Path path = new Path();
{
path.moveTo(1/2 * 200, 1/4 * 200);
path.lineTo(1/4 * 200, 3/4 * 200);
path.lineTo(3/4 * 200, 3/4 …Run Code Online (Sandbox Code Playgroud)