diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Account_.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Account_.java index 352fca083..4aa5370d3 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Account_.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Account_.java @@ -1,37 +1,17 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ +/** + * Generated by OpenJPA MetaModel Generator Tool. +**/ + package org.apache.openjpa.persistence.criteria; import javax.persistence.metamodel.Attribute; -/** - * This source is supposed to be automatically generated from Account.java - * during compilation. - * Hand coded to avoid runtime compiler invocation. Used for testing. - * - * @author Pinaki Poddar - * - */ +@javax.persistence.metamodel.TypesafeMetamodel(value=org.apache.openjpa.persistence.criteria.Account.class) +@javax.annotation.Generated(value="org.apache.openjpa.persistence.meta.AnnotationProcessor6",date="Wed May 06 19:05:08 CDT 2009") public class Account_ { - public static volatile Attribute id; - public static volatile Attribute balance; - public static volatile Attribute loan; - public static volatile Attribute owner; - public static volatile Attribute name; + public static volatile Attribute balance; + public static volatile Attribute id; + public static volatile Attribute loan; + public static volatile Attribute name; + public static volatile Attribute owner; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Contractor.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Contractor.java index 1214af909..3805ebf94 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Contractor.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Contractor.java @@ -19,10 +19,11 @@ package org.apache.openjpa.persistence.criteria; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="CR_CONTRACTOR") -public class Contractor { - +public class Contractor extends Person { } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Exempt.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Exempt.java index 9870b3b52..63e03fe4a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Exempt.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Exempt.java @@ -19,11 +19,16 @@ package org.apache.openjpa.persistence.criteria; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="CR_EXEMPT") public class Exempt { + @Id + @GeneratedValue + private String id; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/FrequentFlierPlan.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/FrequentFlierPlan.java index 5c67343cd..8da6b7ca5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/FrequentFlierPlan.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/FrequentFlierPlan.java @@ -1,9 +1,14 @@ package org.apache.openjpa.persistence.criteria; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; @Entity public class FrequentFlierPlan { + @Id + @GeneratedValue + private String id; private String name; private int annualMiles; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Manager.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Manager.java index 2622c08f9..6f0e55e70 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Manager.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Manager.java @@ -24,6 +24,6 @@ import javax.persistence.Table; @Entity @Table(name="CR_MANAGER") -public class Manager { - +public class Manager extends Employee { + private String cabin; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Person.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Person.java index ffc1c01fe..8e80928c2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Person.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Person.java @@ -21,6 +21,7 @@ package org.apache.openjpa.persistence.criteria; import java.util.List; import javax.persistence.Entity; +import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; @@ -30,6 +31,9 @@ import org.apache.openjpa.persistence.PersistentCollection; @Table(name="CR_PERSON") public class Person { + @Id + private long ssn; + @PersistentCollection private List nicknames; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Student.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Student.java index d7e627a37..98a83cf44 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Student.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/Student.java @@ -19,11 +19,15 @@ package org.apache.openjpa.persistence.criteria; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="CR_STUDENT") public class Student { + @Id + private String name; } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java index 4af5dd23c..097cde7a8 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java @@ -149,6 +149,10 @@ public class TestTypesafeCriteria extends SQLListenerTestCase { assertEquivalence(c, jpql); } + public void testSimpleJoin() { + CriteriaQuery c = cb.create(); +// c.from(Account.class).join(Account_.history) + } void assertEquivalence(CriteriaQuery c, String jpql) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/VideoStore.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/VideoStore.java index 5bc655bc6..eecfbd306 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/VideoStore.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/VideoStore.java @@ -19,6 +19,8 @@ package org.apache.openjpa.persistence.criteria; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; import javax.persistence.Table; /** @@ -29,5 +31,7 @@ import javax.persistence.Table; @Entity @Table(name="CR_VIDEOSTORE") public class VideoStore { + @Id + private String name; }