Save This Page
Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.pc.companyAnnotatedJPA » [javadoc | source]
    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   
   18   package org.apache.jdo.tck.pc.companyAnnotatedJPA;
   19   
   20   import javax.jdo.PersistenceManager;
   21   import org.apache.jdo.tck.pc.company;
   22   
   23   /*
   24    * CompanyFactoryAnnotatedPMFieldClassJPA.java
   25    *
   26    * This class uses the PersistenceManager.newInstance method with the concrete
   27    * class as a parameter.
   28    */
   29   public class CompanyFactoryAnnotatedPMFieldClassJPA
   30           extends org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl {
   31       
   32       Class addressClass = null;
   33       Class dentalInsuranceClass = null;
   34       Class medicalInsuranceClass = null;
   35       Class partTimeEmployeeClass = null;
   36       Class fullTimeEmployeeClass = null;
   37       Class projectClass = null;
   38       Class departmentClass = null;
   39       Class companyClass = null;
   40       
   41       /**
   42        * Creates a new instance of CompanyFactoryAnnotatedPMFieldClassJPA
   43        */
   44       public CompanyFactoryAnnotatedPMFieldClassJPA(PersistenceManager pm) {
   45           super(pm);
   46               addressClass =
   47                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppAddress.class;
   48               dentalInsuranceClass =
   49                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDentalInsurance.class;
   50               medicalInsuranceClass =
   51                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppMedicalInsurance.class;
   52               partTimeEmployeeClass  =
   53                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppPartTimeEmployee.class;
   54               fullTimeEmployeeClass =
   55                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppFullTimeEmployee.class;
   56               projectClass =
   57                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class;
   58               departmentClass =
   59                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDepartment.class;
   60               companyClass =
   61                       org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppCompany.class;
   62       }
   63       
   64       public Class[] getTearDownClasses() {
   65           return new Class[] {
   66               dentalInsuranceClass,
   67               medicalInsuranceClass,
   68               partTimeEmployeeClass,
   69               fullTimeEmployeeClass,
   70               projectClass,
   71               departmentClass,
   72               companyClass
   73           };
   74       }
   75       
   76       public IAddress newAddress() {
   77           return (IAddress)pm.newInstance(addressClass);
   78       }
   79       
   80       public ICompany newCompany() {
   81           return (ICompany)pm.newInstance(companyClass);
   82       }
   83       
   84       public IDentalInsurance newDentalInsurance() {
   85           return (IDentalInsurance)pm.newInstance(dentalInsuranceClass);
   86       }
   87       
   88       public IDepartment newDepartment() {
   89           return (IDepartment)pm.newInstance(departmentClass);
   90       }
   91       
   92       public IFullTimeEmployee newFullTimeEmployee() {
   93           return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass);
   94       }
   95       
   96       public IMedicalInsurance newMedicalInsurance() {
   97           return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass);
   98       }
   99       
  100       public IPartTimeEmployee newPartTimeEmployee() {
  101           return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass);
  102       }
  103       
  104       public IProject newProject() {
  105           return (IProject)pm.newInstance(projectClass);
  106       }
  107   }

Save This Page
Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.pc.companyAnnotatedJPA » [javadoc | source]