mirror of https://github.com/apache/openjpa.git
Metamodel testing classes
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@772474 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ef46be65e
commit
6759d41517
|
@ -1,37 +1,17 @@
|
||||||
/*
|
/**
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Generated by OpenJPA MetaModel Generator Tool.
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.metamodel.Attribute;
|
import javax.persistence.metamodel.Attribute;
|
||||||
|
|
||||||
/**
|
@javax.persistence.metamodel.TypesafeMetamodel(value=org.apache.openjpa.persistence.criteria.Account.class)
|
||||||
* This source is supposed to be automatically generated from Account.java
|
@javax.annotation.Generated(value="org.apache.openjpa.persistence.meta.AnnotationProcessor6",date="Wed May 06 19:05:08 CDT 2009")
|
||||||
* during compilation.
|
|
||||||
* Hand coded to avoid runtime compiler invocation. Used for testing.
|
|
||||||
*
|
|
||||||
* @author Pinaki Poddar
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class Account_ {
|
public class Account_ {
|
||||||
public static volatile Attribute<Account, Long> id;
|
|
||||||
public static volatile Attribute<Account,Integer> balance;
|
public static volatile Attribute<Account,Integer> balance;
|
||||||
|
public static volatile Attribute<Account,Long> id;
|
||||||
public static volatile Attribute<Account,Integer> loan;
|
public static volatile Attribute<Account,Integer> loan;
|
||||||
public static volatile Attribute<Account, String> owner;
|
|
||||||
public static volatile Attribute<Account,String> name;
|
public static volatile Attribute<Account,String> name;
|
||||||
|
public static volatile Attribute<Account,String> owner;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="CR_CONTRACTOR")
|
@Table(name="CR_CONTRACTOR")
|
||||||
public class Contractor {
|
public class Contractor extends Person {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,16 @@
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="CR_EXEMPT")
|
@Table(name="CR_EXEMPT")
|
||||||
|
|
||||||
public class Exempt {
|
public class Exempt {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
private String id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class FrequentFlierPlan {
|
public class FrequentFlierPlan {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private int annualMiles;
|
private int annualMiles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@ import javax.persistence.Table;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="CR_MANAGER")
|
@Table(name="CR_MANAGER")
|
||||||
|
|
||||||
public class Manager {
|
public class Manager extends Employee {
|
||||||
|
private String cabin;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.openjpa.persistence.criteria;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@ -30,6 +31,9 @@ import org.apache.openjpa.persistence.PersistentCollection;
|
||||||
@Table(name="CR_PERSON")
|
@Table(name="CR_PERSON")
|
||||||
|
|
||||||
public class Person {
|
public class Person {
|
||||||
|
@Id
|
||||||
|
private long ssn;
|
||||||
|
|
||||||
@PersistentCollection
|
@PersistentCollection
|
||||||
private List<String> nicknames;
|
private List<String> nicknames;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,15 @@
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="CR_STUDENT")
|
@Table(name="CR_STUDENT")
|
||||||
|
|
||||||
public class Student {
|
public class Student {
|
||||||
|
@Id
|
||||||
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,6 +149,10 @@ public class TestTypesafeCriteria extends SQLListenerTestCase {
|
||||||
assertEquivalence(c, jpql);
|
assertEquivalence(c, jpql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSimpleJoin() {
|
||||||
|
CriteriaQuery c = cb.create();
|
||||||
|
// c.from(Account.class).join(Account_.history)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void assertEquivalence(CriteriaQuery c, String jpql) {
|
void assertEquivalence(CriteriaQuery c, String jpql) {
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
package org.apache.openjpa.persistence.criteria;
|
package org.apache.openjpa.persistence.criteria;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,5 +31,7 @@ import javax.persistence.Table;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="CR_VIDEOSTORE")
|
@Table(name="CR_VIDEOSTORE")
|
||||||
public class VideoStore {
|
public class VideoStore {
|
||||||
|
@Id
|
||||||
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue