1 /* -*- mode: java; c-basic-offset: 4; indent-tabs-mode: nil; -*- 2 * vim:expandtab:shiftwidth=4:tabstop=4:smarttab: 3 * 4 * Copyright 2010 Sun Microsystems, Inc. 5 * All rights reserved. Use is subject to license terms. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License, version 2.0, 9 * as published by the Free Software Foundation. 10 * 11 * This program is also distributed with certain software (including 12 * but not limited to OpenSSL) that is licensed under separate terms, 13 * as designated in a particular file or component or in included license 14 * documentation. The authors of MySQL hereby grant you an additional 15 * permission to link the program and your derivative works with the 16 * separately licensed software that they have included with MySQL. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU General Public License, version 2.0, for more details. 22 * 23 * You should have received a copy of the GNU General Public License 24 * along with this program; if not, write to the Free Software 25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 */ 27 28 package com.mysql.cluster.crund; 29 30 import java.io.Serializable; 31 import java.io.ObjectInputStream; 32 import java.io.ObjectOutputStream; 33 import java.io.IOException; 34 35 /** 36 * An Entity test class. 37 */ 38 @javax.persistence.Entity 39 @javax.persistence.Table(name="b0") 40 public class B0 implements Serializable { 41 // @javax.persistence.Basic default for primitive types, wrappers, String 42 // Defaults: 43 // fetch=EAGER 44 // optional=true (value of all nonprimitive field/property may be null) 45 // @javax.persistence.Lob specifies for the @Basic mapping that a 46 // persistent property or field should be persisted as a large object 47 // to a database-supported large object type. A Lob may be either a 48 // binary or character type. 49 // @javax.persistence.Transient specify a field or property of an entity 50 // that is not persistent 51 // @javax.persistence.ManyToOne for a single-valued association to another 52 // entity class that has many-to-one multiplicity. Defaults: 53 // cascade=new javax.persistence.CascadeType[]{} 54 // fetch=javax.persistence.FetchType.EAGER 55 // optional=true (value of all field/property may be null) 56 // @javax.persistence.ManyToOne for a many-valued association to another 57 // entity class that has one-to-many multiplicity. Defaults: 58 // [mappedBy=field_name (relationship is bidirectional)] 59 // cascade=new javax.persistence.CascadeType[]{} 60 // fetch=javax.persistence.FetchType.LAZY 61 // optional=true (value of all field/property may be null) 62 63 @javax.persistence.Id 64 private int id; 65 66 private int cint; 67 68 private long clong; 69 70 private float cfloat; 71 72 private double cdouble; 73 74 @javax.persistence.Basic(fetch=javax.persistence.FetchType.LAZY) 75 private byte[] cvarbinary_def; 76 77 @javax.persistence.Basic(fetch=javax.persistence.FetchType.LAZY) 78 private String cvarchar_def; 79 80 @javax.persistence.ManyToOne(fetch=javax.persistence.FetchType.LAZY) 81 @javax.persistence.Column(name="a_id") 82 @org.apache.openjpa.persistence.jdbc.Index(name="I_B0_FK") 83 private A a; 84 B0()85 public B0() { 86 } 87 getId()88 public int getId() { 89 return id; 90 } 91 setId(int id)92 public void setId(int id) { 93 this.id = id; 94 } 95 getCint()96 public int getCint() { 97 return cint; 98 } 99 setCint(int cint)100 public void setCint(int cint) { 101 this.cint = cint; 102 } 103 getClong()104 public long getClong() { 105 return clong; 106 } 107 setClong(long clong)108 public void setClong(long clong) { 109 this.clong = clong; 110 } 111 getCfloat()112 public float getCfloat() { 113 return cfloat; 114 } 115 setCfloat(float cfloat)116 public void setCfloat(float cfloat) { 117 this.cfloat = cfloat; 118 } 119 getCdouble()120 public double getCdouble() { 121 return cdouble; 122 } 123 setCdouble(double cdouble)124 public void setCdouble(double cdouble) { 125 this.cdouble = cdouble; 126 } 127 getCvarbinary_def()128 public byte[] getCvarbinary_def() { 129 return cvarbinary_def; 130 } 131 setCvarbinary_def(byte[] cvarbinary_def)132 public void setCvarbinary_def(byte[] cvarbinary_def) { 133 this.cvarbinary_def = cvarbinary_def; 134 } 135 getCvarchar_def()136 public String getCvarchar_def() { 137 return cvarchar_def; 138 } 139 setCvarchar_def(String cvarchar_def)140 public void setCvarchar_def(String cvarchar_def) { 141 this.cvarchar_def = cvarchar_def; 142 } 143 getA()144 public A getA() { 145 return a; 146 } 147 setA(A a)148 public void setA(A a) { 149 this.a = a; 150 } 151 152 // while implementing Serializable... 153 static private final long serialVersionUID = 4644052765183330073L; 154 155 // while implementing Serializable... readObject(ObjectInputStream in)156 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { 157 in.defaultReadObject(); 158 } 159 160 // while implementing Serializable... writeObject(ObjectOutputStream out)161 private void writeObject(ObjectOutputStream out) throws IOException { 162 out.defaultWriteObject(); 163 } 164 165 /* 166 static public class Oid implements Serializable { 167 168 public int id; 169 170 public Oid() { 171 } 172 173 public boolean equals(Object obj) { 174 if (obj == null || !this.getClass().equals(obj.getClass())) 175 return false; 176 Oid o = (Oid)obj; 177 return (this.id == o.id); 178 } 179 180 public int hashCode() { 181 return id; 182 } 183 } 184 */ 185 } 186