openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r627979 [5/39] - in /openjpa/trunk: openjpa-lib/src/test/java/org/apache/openjpa/lib/test/ openjpa-persistence-jdbc/ openjpa-persistence-jdbc/src/test/java/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/ openjpa-pers...
Date Fri, 15 Feb 2008 09:20:40 GMT
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Employee.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Employee.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Employee.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Employee.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,106 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+@Entity
+@Inheritance(strategy=InheritanceType.JOINED)
+@EntityListeners({NameValidator.class, LongNameValidator.class})
+public class Employee implements NamedEntity
+{
+	@Id
+	private int id;
+
+	@Basic
+	protected String name;
+
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	protected int lifecheck;
+
+	@Transient
+	protected long syncTime;
+
+	public Employee()
+	{}
+
+	public Employee(int id, String name)
+	{
+		this.id = id;
+		this.name = name;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public void setId(int id)
+	{
+		this.id = id;
+	}
+
+	public int getId()
+	{
+		return id;
+	}
+
+	@PostPersist
+	private void resetSyncTime()
+	{
+		System.out.println("resetSyncTime is running on "+this+"GEN #: "+lifecheck);
+		syncTime = System.currentTimeMillis();
+
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("employeepop");
+		store.getClist().add("gen#"+lifecheck);
+	}
+
+	@PostLoad
+	public void pload()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("employeepol");
+	}
+
+	@PostUpdate
+	public void pupdate()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("employeepou");
+	}
+
+	public String toString()
+	{
+		return "Name: "+name+" of "+this.getClass().getName()+" Id: "+id+" Synctime: "+syncTime;
+	}
+
+	public int getCheck() {
+		return this.lifecheck;
+	}
+
+	public void setCheck(int check) {
+		this.lifecheck = check;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity1.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity1.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity1.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,117 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToOne;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+
+@Entity
+@Table(name="entity_1")
+@Inheritance(strategy=InheritanceType.JOINED)
+@SqlResultSetMapping(name="NativeTestResult", entities=@EntityResult(entityClass=Entity1.class))
+public class Entity1 implements Serializable
+{
+	private static final long serialVersionUID = 2882935803066041165L;
+
+	@Id
+	protected long pk;
+
+	@Basic
+	@Column(length=35)
+	protected String stringField;
+
+	@Basic
+	protected int intField;
+
+	@OneToOne(cascade={CascadeType.REMOVE, CascadeType.PERSIST})
+	protected Entity2 entity2Field;
+
+	@Version
+	protected int versionField;
+
+	public Entity1()
+	{}
+
+	public Entity1 (long pk, String stringField, int intField)
+	{
+		this.pk = pk;
+		this.stringField = stringField;
+		this.intField = intField;
+	}
+
+
+	public long getPk ()
+	{
+		return pk;
+	}
+
+
+	public void setStringField (String val)
+	{
+		stringField = val;
+	}
+
+
+	public String getStringField ()
+	{
+		return stringField;
+	}
+
+
+	public void setIntField (int val)
+	{
+		intField = val;
+	}
+
+
+	public int getIntField ()
+	{
+		return intField;
+	}
+
+
+	public void setEntity2Field (Entity2 val)
+	{
+		entity2Field = val;
+	}
+
+
+	public Entity2 getEntity2Field ()
+	{
+		return entity2Field;
+	}
+
+	public String toString()
+	{
+		return("PK: "+pk+" StringField: "+stringField+" IntField: "+intField);
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity2.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Entity2.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,95 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+
+
+//@Entity(name="entity2ExplicitName")
+@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+public class Entity2 implements Serializable
+{
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = 4723739219953167343L;
+
+	@Id
+	protected long pk;
+
+	@Basic
+	@Column(length=35)
+	protected String stringField;
+
+	@Basic
+	protected int intField;
+
+	public Entity2()
+	{}
+
+
+	public Entity2 (long pk, String stringField, int intField)
+	{
+		this.pk = pk;
+		this.stringField = stringField;
+		this.intField = intField;
+	}
+
+
+	public long getPk ()
+	{
+		return pk;
+	}
+
+
+	public void setStringField (String val)
+	{
+		stringField = val;
+	}
+
+
+	public String getStringField ()
+	{
+		return stringField;
+	}
+
+	public void setIntField (int val)
+	{
+		intField = val;
+	}
+
+
+	public int getIntField ()
+	{
+		return intField;
+	}
+
+	public String toString()
+	{
+		return("PK: "+pk+" StringField: "+stringField+" IntField: "+intField);
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,39 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.CallbackStorage;
+
+public class EntityDDListener 
+{
+	public EntityDDListener()
+	{}
+	
+	public void verifyPostRemove(Object lcd)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifypor");
+	}
+	
+	public void verifyPostUpdate(Object lcd)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifypou");
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener2.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/EntityDDListener2.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,36 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.CallbackStorage;
+
+public class EntityDDListener2 
+{
+	public void verifyPreUpdate(Object lcd)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("def2-verifypru");
+	}
+	
+	public void verifyPostLoad(Object lcd)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("def2-verifypol");
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/FlightSchedule.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/FlightSchedule.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/FlightSchedule.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/FlightSchedule.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,56 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+import java.util.*;
+
+@Entity
+@DiscriminatorValue("fsched")
+//@Table(name="Flight_Sched",
+//		uniqueConstraints=@UniqueConstraint(columnNames={"planeName"}))
+public class FlightSchedule extends Schedule
+{
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private int FlightNum;
+
+	@Column(name="flight_name")
+	private String planeName;
+
+	public FlightSchedule(){}
+
+	public FlightSchedule(String name, Calendar cad, Date start, Date end, String pname)
+	{
+		super(name, cad, start, end);
+		this.planeName = pname;
+	}
+
+	public String getFlightName() {
+		return planeName;
+	}
+
+	public void setFlightName(String flightName) {
+		planeName = flightName;
+	}
+
+	public int getFlightNum() {
+		return FlightNum;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDD.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDD.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDD.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDD.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,23 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+public interface LifeCycleDD 
+{
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,89 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.CallbackStorage;
+
+@Entity
+public class LifeCycleDDEntity
+{
+	@Id
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private int id;
+	
+	@Basic
+	private String name;
+	
+	@Basic
+	private String surname;
+	
+	public LifeCycleDDEntity()
+	{}
+	
+	public LifeCycleDDEntity(String name, String surname)
+	{
+		this.name = name;
+		this.surname = surname;
+	}
+	
+	public void verifyPrePersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifyprp");
+	}
+	
+	public void verifyPostPersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifypop");
+	}
+	
+    public void verifyPreRemove()
+    {
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifyprr");
+    }
+    
+    public int getId()
+    {
+    	return id;
+    }
+    
+    public void setName(String name)
+    {
+    	this.name = name;
+    }
+    
+    public String getName()
+    {
+    	return name;
+    }
+    
+    public void setSurName(String name)
+    {
+    	this.surname = name;
+    }
+    
+    public String getSurName()
+    {
+    	return surname;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity2.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntity2.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,105 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
+import javax.persistence.ExcludeDefaultListeners;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.PostPersist;
+import javax.persistence.PrePersist;
+import javax.persistence.PreRemove;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.CallbackStorage;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.LongNameValidator;
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.NameValidator;
+
+@Entity
+public class LifeCycleDDEntity2
+{
+	@Id
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private int id;
+	
+	@Basic
+	private String name;
+	
+	@Basic
+	private String surname;
+	
+	public LifeCycleDDEntity2()
+	{		
+	}
+	
+	public LifeCycleDDEntity2(String name, String surname)
+	{
+		this.name = name;
+		this.surname = surname;
+	}
+	
+	@PrePersist
+	public void verifyPrePersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifyprp");
+	}
+	
+	@PostPersist
+	public void verifyPostPersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifypop");
+	}
+	
+	@PreRemove
+    public void verifyPreRemove()
+    {
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("verifyprr");
+    }
+    
+    public int getId()
+    {
+    	return id;
+    }
+    
+    public void setName(String name)
+    {
+    	this.name = name;
+    }
+    
+    public String getName()
+    {
+    	return name;
+    }
+    
+    public void setSurName(String name)
+    {
+    	this.surname = name;
+    }
+    
+    public String getSurName()
+    {
+    	return surname;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntitySub.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntitySub.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntitySub.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LifeCycleDDEntitySub.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,54 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+import org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype.CallbackStorage;
+
+@Entity
+@DiscriminatorValue("SUB")
+public class LifeCycleDDEntitySub extends LifeCycleDDEntity
+{
+	public LifeCycleDDEntitySub()
+	{}
+	
+	public LifeCycleDDEntitySub(String n, String sn)
+	{
+		super(n, sn);
+	}
+	
+	public void verifyPrePersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("over-verifyprp");
+	}
+	
+	public void verifyPostPersist()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("over-verifypop");
+	}
+	
+    public void verifyPreRemove()
+    {
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("over-verifyprr");
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LongNameValidator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LongNameValidator.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LongNameValidator.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/LongNameValidator.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+public class LongNameValidator
+{
+	@PrePersist
+	public void validateName(NamedEntity obj)
+	{
+		System.out.println("LongNameValidator is running on "+obj);
+		if(obj.getName().equals("") || obj.getName() == null)
+			throw new NullPointerException();
+
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("longnamevalidatorprr");
+	}
+
+	@PostUpdate
+	public void testpost(NamedEntity obj)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("longnamevalidatorpou");
+	}
+
+
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NameValidator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NameValidator.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NameValidator.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NameValidator.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+public class NameValidator
+{
+	@PrePersist
+	public void validateName(NamedEntity obj)
+	{
+		System.out.println("NameValidator is running on "+obj);
+		if(obj.getName().equals("") || obj.getName() == null)
+			throw new NullPointerException();
+
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("namevalidator");
+	}
+
+	@PostUpdate
+	public void testpost(NamedEntity obj)
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("namevalidatorpou");
+	}
+
+	@PostRemove
+	public void validateNothing(NamedEntity obj)
+	{
+		System.out.println("NameValidator is running on ");
+
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("namevalidatorpor");
+	}
+
+	@PreRemove
+	public void validateNothing1(NamedEntity obj)
+	{
+		System.out.println("NameValidator is running on ");
+
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("namevalidatorprr");
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NamedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NamedEntity.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NamedEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/NamedEntity.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,26 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+
+public interface NamedEntity
+{
+	public String getName();
+
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Schedule.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Schedule.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Schedule.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/Schedule.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,102 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import java.util.Date;
+import java.util.Calendar;
+
+import javax.persistence.*;
+
+@Entity
+//@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+@EntityListeners({DateValidator.class, StringValidator.class})
+public class Schedule
+{
+	@Id
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private int id;
+
+	@Temporal(TemporalType.DATE)
+	@Basic
+	private Calendar dob;
+
+	@Temporal(TemporalType.TIME)
+	@Basic
+	private Date startDate;
+
+	@Temporal(TemporalType.TIMESTAMP)
+	@Basic
+	private Date endDate;
+
+	@Basic
+	private String name;
+
+	public Schedule(){}
+
+	public Schedule(String name, Calendar cad, Date sdate, Date endDate)
+	{
+		this.name = name;
+		this.dob = cad;
+		this.startDate = sdate;
+		this.endDate = endDate;
+	}
+
+	public Calendar getDob() {
+		return dob;
+	}
+
+	public void setDob(Calendar dob) {
+		this.dob = dob;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String toString()
+	{
+		return "Schedule "+name+" Date "+startDate;
+	}
+
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/StringValidator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/StringValidator.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/StringValidator.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/StringValidator.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,37 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import javax.persistence.*;
+
+public class StringValidator
+{
+	@PrePersist
+	public void prePersist(FlightSchedule sched)
+	{
+		if(sched.getName().length() == 0 || sched.getName().equals(""))
+			throw new IllegalArgumentException("Needs a valid name");
+	}
+
+	@PostPersist
+	public void postPersist(FlightSchedule sched)
+	{
+		System.out.println("Schedule "+sched+" is successfully persisted: StringValidator.class");
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/TxRollbackEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/TxRollbackEntity.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/TxRollbackEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/annotations/common/apps/annotApp/ddtype/TxRollbackEntity.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,73 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.annotations.common.apps.annotApp.ddtype;
+
+import java.util.ArrayList;
+
+import javax.persistence.Basic;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.PostLoad;
+import javax.persistence.PostPersist;
+import javax.persistence.Entity;
+import javax.persistence.PostRemove;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="TX_ROLLBACK_ENT")
+public class TxRollbackEntity
+{
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	@Id
+	private int id;
+
+	@Basic
+	private String name;
+
+	public TxRollbackEntity(String name)
+	{
+		this.name = name;
+	}
+
+	@PostLoad
+	public void rollBackException()
+	{
+		//should throw a null pointer exception causing the tx to be rolled back
+		ArrayList<Integer> list = null;
+		list.add(1);
+	}
+
+	@PostRemove
+	public void bomb()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("rollbackpor1");
+	}
+
+	public void bomb2()
+	{
+		CallbackStorage store = CallbackStorage.getInstance();
+		store.getClist().add("rollbackpor");
+	}
+
+	public int getId() {
+		return id;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/TestQueryCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/TestQueryCache.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/TestQueryCache.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/TestQueryCache.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,183 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.cache;
+
+import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.NamedQuery;
+
+import org.apache.openjpa.persistence.cache.common.apps.Entity1;
+import org.apache.openjpa.persistence.cache.common.apps.Entity2;
+import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
+
+@NamedQuery(name = "setParam1",
+    query = "SELECT o FROM Entity1 o WHERE o.pk LIKE :pk")
+public class TestQueryCache extends AbstractTestCase {
+
+    EntityManager em;
+
+    public TestQueryCache(String name) {
+        super(name);
+        System.setProperty("cactus.contextURL",
+            "http://localhost:9000/cachecactus");
+        em = currentEntityManager();
+    }
+
+    /*public static Test suite()
+    {
+        ServletTestSuite suite = new ServletTestSuite();
+        suite.addTestSuite(TestQueryCache.class);
+        return suite;
+    }*/
+    public void setUp() {
+        System.setProperty("cactus.contextURL",
+            "http://localhost:9000/cactuswebapp");
+
+        //deleteAll(Entity2.class);
+        deleteAll(Entity1.class);
+
+        int instNum = 10;
+
+        startTx(em);
+
+        //create and persist multiple entity1 instances
+        for (int i = 0; i < instNum; i++) {
+            Entity1 ent = new Entity1(i, "string" + i, i + 2);
+            Entity2 ent2 = new Entity2(i * 2, "ent2" + i, i);
+            ent.setEntity2Field(ent2);
+            em.persist(ent);
+        }
+
+        endTx(em);
+        endEm(em);
+    }
+
+    public void testResultList() {
+        em = currentEntityManager();
+        List list = em.createQuery("Select object(o) from Entity1 o")
+            .getResultList();
+
+        assertEquals(10, list.size());
+
+        endEm(em);
+    }
+
+    public void testGetSingleList() {
+        em = currentEntityManager();
+        String curr = 2 + "";
+
+        Entity1 ret = (Entity1) em
+            .createQuery("SELECT o FROM Entity1 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", curr)
+            .getSingleResult();
+
+        assertNotNull(ret);
+        assertEquals("string2", ret.getStringField());
+        assertEquals(4, ret.getIntField());
+
+        endEm(em);
+    }
+
+    public void testExecuteUpdate() {
+        String curr = 2 + "";
+        String curr2 = 22 + "";
+
+        em = currentEntityManager();
+        startTx(em);
+
+        Entity1 entity1 = (Entity1) em
+            .createQuery("SELECT o FROM Entity1 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", curr)
+            .getSingleResult();
+
+        int ret = em.createQuery("Delete FROM Entity1 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", curr)
+            .executeUpdate();
+        assertEquals(ret, 1);
+
+//cascade remove doesn't remove the entity2
+        int retTmp = em.createQuery("Delete FROM Entity2 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", entity1.getEntity2Field().getPk())
+            .executeUpdate();
+
+        int ret2 = em.createQuery("Delete FROM Entity1 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", curr2)
+            .executeUpdate();
+
+        assertEquals(ret2, 0);
+
+        endTx(em);
+        endEm(em);
+    }
+
+    public void testSetMaxResults() {
+        em = currentEntityManager();
+
+        List l = em.createQuery("Select object(o) from Entity1 o")
+            .setMaxResults(5)
+            .getResultList();
+
+        assertNotNull(l);
+        assertEquals(5, l.size());
+
+        endEm(em);
+    }
+
+    public void testSetFirstResults() {
+        em = currentEntityManager();
+
+        List l = em.createQuery("Select object(o) from Entity1 o")
+            .setFirstResult(3)
+            .getResultList();
+
+        Entity1 ent = (Entity1) l.get(0);
+
+        assertNotNull(ent);
+        assertEquals("string3", ent.getStringField());
+        assertEquals(5, ent.getIntField());
+
+        endEm(em);
+    }
+
+    // Tests Binding an argument to a named parameter.
+    // pk, the named parameter --Not working yet--
+    public void xxxtestSetParameter1() {
+
+        em = currentEntityManager();
+        String curr = 2 + "";
+
+        List ret = em.createQuery("SELECT o FROM Entity1 o WHERE o.pk LIKE :pk")
+            .setParameter("pk", curr)
+            .getResultList();
+
+        assertNotNull(ret);
+        assertEquals(1, ret.size());
+
+        ret = em.createNamedQuery("setParam1")
+            .setParameter("pk", curr)
+            .getResultList();
+
+        assertNotNull(ret);
+        assertEquals(1, ret.size());
+
+        endTx(em);
+    }
+
+    //rest of the interface is tested by the CTS
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity1.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity1.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity1.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,99 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.cache.common.apps;
+
+import java.io.Serializable;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToOne;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.Version;
+
+@Entity
+@Inheritance(strategy = InheritanceType.JOINED)
+@SqlResultSetMapping(name = "NativeTestResult",
+    entities = @EntityResult(entityClass = Entity1.class))
+public class Entity1 implements Serializable {
+
+    private static final long serialVersionUID = 2882935803066041165L;
+
+    @Id
+    protected long pk;
+
+    @Basic
+    @Column(length = 35)
+    protected String stringField;
+
+    @Basic
+    protected int intField;
+
+    @OneToOne(cascade = { CascadeType.REMOVE, CascadeType.PERSIST })
+    protected Entity2 entity2Field;
+
+    @Version
+    protected int versionField;
+
+    public Entity1() {
+    }
+
+    public Entity1(long pk, String stringField, int intField) {
+        this.pk = pk;
+        this.stringField = stringField;
+        this.intField = intField;
+    }
+
+    public long getPk() {
+        return pk;
+    }
+
+    public void setStringField(String val) {
+        stringField = val;
+    }
+
+    public String getStringField() {
+        return stringField;
+    }
+
+    public void setIntField(int val) {
+        intField = val;
+    }
+
+    public int getIntField() {
+        return intField;
+    }
+
+    public void setEntity2Field(Entity2 val) {
+        entity2Field = val;
+    }
+
+    public Entity2 getEntity2Field() {
+        return entity2Field;
+    }
+
+    public String toString() {
+        return ("PK: " + pk + " StringField: " + stringField + " IntField: " +
+            intField);
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity2.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/common/apps/Entity2.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,82 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.cache.common.apps;
+
+import java.io.Serializable;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+
+//@Entity(name="entity2ExplicitName")
+@Entity
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+public class Entity2 implements Serializable {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 4723739219953167343L;
+
+    @Id
+    protected long pk;
+
+    @Basic
+    @Column(length = 35)
+    protected String stringField;
+
+    @Basic
+    protected int intField;
+
+    public Entity2() {
+    }
+
+    public Entity2(long pk, String stringField, int intField) {
+        this.pk = pk;
+        this.stringField = stringField;
+        this.intField = intField;
+    }
+
+    public long getPk() {
+        return pk;
+    }
+
+    public void setStringField(String val) {
+        stringField = val;
+    }
+
+    public String getStringField() {
+        return stringField;
+    }
+
+    public void setIntField(int val) {
+        intField = val;
+    }
+
+    public int getIntField() {
+        return intField;
+    }
+
+    public String toString() {
+        return ("PK: " + pk + " StringField: " + stringField + " IntField: " +
+            intField);
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Address.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Address.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Address.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Address.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,94 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.*;
+
+@Entity
+public class Address
+{
+	@Basic
+	@Column(length=50)
+	private String streetAd;
+
+	@Basic
+	@Column(length=50)
+	private String city;
+
+	@Basic
+	@Column(length=50)
+	private String country;
+
+	@Basic
+	@Column(length=25)
+	private String zipcode;
+
+	@OneToOne(mappedBy="address")
+	private CompUser user;
+
+	@Id
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private int id;
+
+	public Address(){}
+
+	public Address(String streetAd, String city, String country, String zipcode)
+	{
+		this.streetAd = streetAd;
+		this.city = city;
+		this.country = country;
+		this.zipcode = zipcode;
+	}
+
+	public String getCity() {
+		return city;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public String getCountry() {
+		return country;
+	}
+
+	public void setCountry(String country) {
+		this.country = country;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public String getStreetAd() {
+		return streetAd;
+	}
+
+	public void setStreetAd(String streetAd) {
+		this.streetAd = streetAd;
+	}
+
+	public String getZipcode() {
+		return zipcode;
+	}
+
+	public void setZipcode(String zipcode) {
+		this.zipcode = zipcode;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ArtCourse.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ArtCourse.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ArtCourse.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ArtCourse.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+@Entity
+@DiscriminatorValue("Art")
+public class ArtCourse extends Course
+{
+	private static final long serialVersionUID = 1L;
+
+	private String relCourse;
+
+	public ArtCourse(String relCourse)
+	{
+		this.relCourse = relCourse;
+	}
+
+	public ArtCourse(int id, String relCourse)
+	{
+		super(id);
+		this.relCourse = relCourse;
+	}
+
+	public String getRelCourse()
+	{
+		return relCourse;
+	}
+
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/CompUser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/CompUser.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/CompUser.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/CompUser.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,98 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.*;
+import org.apache.openjpa.persistence.*;
+
+import java.util.*;
+
+@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+public class CompUser
+{
+	@Basic
+	@Column(length=50)
+	private String name;
+
+	@Basic
+	private int age;
+
+	@Basic
+	@Column(name="compName", length=50)
+	private String computerName;
+
+	@PersistentCollection
+	private String[] nicknames = new String[0];
+
+	@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
+	@JoinColumn(name="ADD_ID")
+	private Address address;
+
+	@Id
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	public int userid;
+
+	public CompUser(){}
+
+	public CompUser(String name, String cName, Address address, int age)
+	{
+		this.name = name;
+		this.computerName = cName;
+		this.address = address;
+		this.age = age;
+	}
+
+	public String getComputerName() {
+		return computerName;
+	}
+
+	public void setComputerName(String computerName) {
+		this.computerName = computerName;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public int getUserid() {
+		return userid;
+	}
+
+	public Address getAddress() {
+		return address;
+	}
+
+	public void setAddress(Address address) {
+		this.address = address;
+	}
+
+	public int getAge() {
+		return age;
+	}
+
+	public void setAge(int age) {
+		this.age = age;
+	}
+
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ComplexEmbeddedPC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ComplexEmbeddedPC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ComplexEmbeddedPC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ComplexEmbeddedPC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,77 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+
+import java.util.*;
+
+import javax.persistence.*;
+
+
+/**
+ *	<p>Embedded type used in testing.</p>
+ *
+ *	@author		Abe White
+ */
+@Entity
+public class ComplexEmbeddedPC
+{
+	@Basic
+	private String 				stringField;
+
+	@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
+	private EmbeddedOwnerPC		ownerField;
+
+	private Set					stringSet = new HashSet ();
+
+
+	public String getStringField ()
+	{
+		return this.stringField;
+	}
+
+
+	public void setStringField (String stringField)
+	{
+		this.stringField = stringField;
+	}
+
+
+	public EmbeddedOwnerPC getOwnerField ()
+	{
+		return this.ownerField;
+	}
+
+
+	public void setOwnerField (EmbeddedOwnerPC ownerField)
+	{
+		this.ownerField = ownerField;
+	}
+
+
+	public Set getStringSet ()
+	{
+		return this.stringSet;
+	}
+
+	public void setStringSet (Set stringSet)
+	{
+		this.stringSet = stringSet;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Course.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Course.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Course.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Course.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,82 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.*;
+
+@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+public class Course implements Serializable
+{
+	@Transient
+	private static final long serialVersionUID = 1L;
+
+	@Basic
+	private String name;
+
+	@Basic
+	private int units;
+
+	@ManyToMany(mappedBy="course")
+	private List<Student> students;
+
+	@Id
+	private int courseId;
+
+	public Course(){}
+
+	public Course(int courseId)
+	{
+		this.courseId = courseId;
+	}
+
+	public Course(String name, int units, int courseId)
+	{
+		this.name = name;
+		this.units = units;
+		this.courseId = courseId;
+	}
+
+	public int getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(int courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public int getUnits() {
+		return units;
+	}
+
+	public void setUnits(int units) {
+		this.units = units;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Department.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Department.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Department.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Department.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,70 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.*;
+import java.io.*;
+import java.util.*;
+
+
+@Entity
+public class Department implements Serializable
+{
+	@Transient
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	private int id;
+
+	@Basic
+	private String name;
+
+	@ManyToMany(mappedBy="department")
+	private List<Student> slist;
+
+	public Department(){}
+
+	public Department(int id)
+	{
+		this.id = id;
+	}
+
+	public Department(String name, List<Student> slist, int id)
+	{
+		this.name = name;
+		this.slist = slist;
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public List<Student> getSlist() {
+		return slist;
+	}
+
+	public void setSlist(List<Student> slist) {
+		this.slist = slist;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedOwnerPC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedOwnerPC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedOwnerPC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedOwnerPC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,158 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+
+/**
+ *	<p>Persistent type used in testing embedded instances.</p>
+ *
+ *	@author		Abe White
+ */
+@Entity
+@Table(name="embownpc")
+@IdClass(EmbeddedOwnerPC.EmbKey.class)
+public class EmbeddedOwnerPC
+{
+	@Id
+	private int					id1;
+	@Id
+	private int					id2;
+	@Basic
+	private String				stringField;
+
+	@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
+	private EmbeddedPC 			embedded;
+
+	@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
+	private ComplexEmbeddedPC	complexEmbedded;
+
+
+	protected EmbeddedOwnerPC ()
+	{
+	}
+
+	public EmbeddedOwnerPC (int id1, int id2)
+	{
+		this.id1 = id1;
+		this.id2 = id2;
+	}
+
+
+	public int getId1 ()
+	{
+		return id1;
+	}
+
+
+	public int getId2 ()
+	{
+		return id2;
+	}
+
+
+	public EmbeddedPC getEmbedded ()
+	{
+		return this.embedded;
+	}
+
+
+	public void setEmbedded (EmbeddedPC embedded)
+	{
+		this.embedded = embedded;
+	}
+
+
+	public String getStringField ()
+	{
+		return this.stringField;
+	}
+
+
+	public void setStringField (String stringField)
+	{
+		this.stringField = stringField;
+	}
+
+
+	public ComplexEmbeddedPC getComplexEmbedded ()
+	{
+		return this.complexEmbedded;
+	}
+
+
+	public void setComplexEmbedded (ComplexEmbeddedPC complexEmbedded)
+	{
+		this.complexEmbedded = complexEmbedded;
+	}
+
+	public static class EmbKey implements Serializable
+	{
+		public int					id1;
+		public int					id2;
+
+		public EmbKey()
+		{
+		}
+
+		public EmbKey (String str)
+		{
+			int index = str.indexOf (":");
+			if (index != -1)
+			{
+				id1 = Integer.parseInt (str.substring (0, index));
+				id2 = Integer.parseInt(str.substring (index + 1));
+			}
+		}
+
+		@Override
+		public boolean equals(Object other)
+		{
+			if(!(other instanceof EmbKey))
+				  return false;
+
+	     	EmbKey touse = (EmbKey)other;
+
+			if (id2 == 0 && touse.id2 != 0)
+				return false;
+			if (id2 != 0 && touse.id2 == 0)
+				return false;
+			if (!(id1 == touse.id1))
+				return false;
+
+			return true;
+		}
+
+		@Override
+		public int hashCode()
+		{
+			return (id1 + id2+"").hashCode();
+		}
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedPC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedPC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedPC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/EmbeddedPC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.*;
+
+
+/**
+ *	<p>Embedded type used in testing.</p>
+ *
+ *	@author		Abe White
+ */
+@Entity
+@Table(name="embpc")
+public class EmbeddedPC
+{
+	@Id
+	private int		intField;
+
+	private String 	stringField;
+
+
+	public int getIntField ()
+	{
+		return this.intField;
+	}
+
+	public void setIntField (int intField)
+	{
+		this.intField = intField;
+	}
+
+
+	public String getStringField ()
+	{
+		return this.stringField;
+	}
+
+
+	public void setStringField (String stringField)
+	{
+		this.stringField = stringField;
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity1.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity1.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity1.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,117 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToOne;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+
+@Entity
+@Table(name="entity_1")
+@Inheritance(strategy=InheritanceType.JOINED)
+@SqlResultSetMapping(name="NativeTestResult", entities=@EntityResult(entityClass=Entity1.class))
+public class Entity1 implements Serializable
+{
+	private static final long serialVersionUID = 2882935803066041165L;
+
+	@Id
+	protected long pk;
+
+	@Basic
+	@Column(length=35)
+	protected String stringField;
+
+	@Basic
+	protected int intField;
+
+	@OneToOne(cascade={CascadeType.REMOVE, CascadeType.PERSIST})
+	protected Entity2 entity2Field;
+
+	@Version
+	protected int versionField;
+
+	public Entity1()
+	{}
+
+	public Entity1 (long pk, String stringField, int intField)
+	{
+		this.pk = pk;
+		this.stringField = stringField;
+		this.intField = intField;
+	}
+
+
+	public long getPk ()
+	{
+		return pk;
+	}
+
+
+	public void setStringField (String val)
+	{
+		stringField = val;
+	}
+
+
+	public String getStringField ()
+	{
+		return stringField;
+	}
+
+
+	public void setIntField (int val)
+	{
+		intField = val;
+	}
+
+
+	public int getIntField ()
+	{
+		return intField;
+	}
+
+
+	public void setEntity2Field (Entity2 val)
+	{
+		entity2Field = val;
+	}
+
+
+	public Entity2 getEntity2Field ()
+	{
+		return entity2Field;
+	}
+
+	public String toString()
+	{
+		return("PK: "+pk+" StringField: "+stringField+" IntField: "+intField);
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity2.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/Entity2.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,99 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+
+
+//@Entity(name="entity2ExplicitName")
+//@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+/**FIX-ME 
+ * 
+ * It should complain if i uncomment the above strategies...but it does
+ */
+@Entity
+public class Entity2 implements Serializable
+{
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = 4723739219953167343L;
+
+	@Id
+	protected long pk;
+
+	@Basic
+	@Column(length=35)
+	protected String stringField;
+
+	@Basic
+	protected int intField;
+
+	public Entity2()
+	{}
+
+
+	public Entity2 (long pk, String stringField, int intField)
+	{
+		this.pk = pk;
+		this.stringField = stringField;
+		this.intField = intField;
+	}
+
+
+	public long getPk ()
+	{
+		return pk;
+	}
+
+
+	public void setStringField (String val)
+	{
+		stringField = val;
+	}
+
+
+	public String getStringField ()
+	{
+		return stringField;
+	}
+
+	public void setIntField (int val)
+	{
+		intField = val;
+	}
+
+
+	public int getIntField ()
+	{
+		return intField;
+	}
+
+	public String toString()
+	{
+		return("PK: "+pk+" StringField: "+stringField+" IntField: "+intField);
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/FemaleUser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/FemaleUser.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/FemaleUser.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/FemaleUser.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+@Entity(name="FemUser")
+@DiscriminatorValue(value="F")
+public class FemaleUser extends CompUser
+{
+
+	public FemaleUser(){}
+
+	public FemaleUser(String name, String cname, Address add, int age, int id)
+	{
+		super(name, cname, add, age);
+	}
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/MaleUser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/MaleUser.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/MaleUser.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/MaleUser.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.persistence.common.apps;
+
+import javax.persistence.*;
+
+@Entity
+@DiscriminatorValue(value="M")
+public class MaleUser extends CompUser
+{
+	public MaleUser(){}
+
+	public MaleUser(String name, String cname, Address add, int age, int id)
+	{
+		super(name, cname, add, age);
+	}
+}



Mime
View raw message