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:
Pinaki Poddar 2009-05-07 00:19:20 +00:00
parent 2ef46be65e
commit 6759d41517
9 changed files with 42 additions and 35 deletions

View File

@ -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<Account, Long> id;
public static volatile Attribute<Account, Integer> balance;
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,Integer> balance;
public static volatile Attribute<Account,Long> id;
public static volatile Attribute<Account,Integer> loan;
public static volatile Attribute<Account,String> name;
public static volatile Attribute<Account,String> owner;
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -24,6 +24,6 @@ import javax.persistence.Table;
@Entity
@Table(name="CR_MANAGER")
public class Manager {
public class Manager extends Employee {
private String cabin;
}

View File

@ -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<String> nicknames;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;
}