cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r396882 [10/11] - in /incubator/cayenne: branches/ tags/ trunk/ trunk/cayenne-jpa-tck/ trunk/cayenne-jpa-tck/.settings/ trunk/cayenne-jpa-tck/src/ trunk/cayenne-jpa-tck/src/main/ trunk/cayenne-jpa-tck/src/main/java/ trunk/cayenne-jpa-tck/sr...
Date Wed, 26 Apr 2006 20:58:50 GMT
Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity2.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity2.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity2.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity2.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,79 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.PrimaryKeyJoinColumn;
+import javax.persistence.PrimaryKeyJoinColumns;
+
+@Entity
+@PrimaryKeyJoinColumns(value = {
+        @PrimaryKeyJoinColumn(name = "pk_column1", referencedColumnName = "super_column1", columnDefinition = "count(1)"),
+        @PrimaryKeyJoinColumn(name = "pk_column2")
+})
+@Inheritance(strategy = InheritanceType.JOINED)
+@AttributeOverrides(value = {
+        @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1", unique = true, nullable = true, insertable = true, updatable = true, columnDefinition = "count(1)", table = "ao_table1", length = 3, precision = 4, scale = 5)),
+        @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2", unique = true, nullable = true, insertable = true, updatable = true, columnDefinition = "count(1)", table = "ao_table1", length = 3, precision = 4, scale = 5))
+})
+public class MockEntity2 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity3.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity3.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity3.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity3.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,71 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@Entity
+@DiscriminatorColumn(name = "column1", discriminatorType = DiscriminatorType.CHAR, columnDefinition = "count(1)", length = 5)
+@DiscriminatorValue(value = "DV")
+public class MockEntity3 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity4.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity4.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity4.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity4.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,73 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+
+@Entity
+public class MockEntity4 {
+
+    @EmbeddedId
+    @AttributeOverrides(value = {
+            @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1")),
+            @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2"))
+    })
+    protected Object embeddedId;
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity5.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity5.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity5.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntity5.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,155 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.Lob;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapKey;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.UniqueConstraint;
+import javax.persistence.Version;
+
+@Entity
+public class MockEntity5 {
+
+    @Basic
+    protected String attribute1;
+
+    @Version
+    protected int attribute2;
+
+    @OneToOne(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, optional = true, mappedBy = "mb1", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute3;
+
+    @OneToMany(targetEntity = MockTargetEntity2.class, fetch = FetchType.LAZY, mappedBy = "mb2", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute4;
+
+    @ManyToOne(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, optional = true, cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute5;
+
+    @ManyToMany(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, mappedBy = "mb4", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute6;
+
+    @Embedded
+    protected int attribute7;
+
+    @Transient
+    protected int attribute8;
+
+    @Column(name = "column9")
+    protected int attribute9;
+
+    @JoinColumn(name = "join-column-10", referencedColumnName = "x-ref", unique = true, nullable = true, insertable = true, updatable = true, columnDefinition = "x-def", table = "jt1")
+    protected int attribute10;
+
+    @JoinTable(name = "jtable1", catalog = "catalog1", schema = "schema1", joinColumns = {
+            @JoinColumn(name = "join-column1"), @JoinColumn(name = "join-column2")
+    }, inverseJoinColumns = {
+            @JoinColumn(name = "ijoin-column1"), @JoinColumn(name = "ijoin-column2")
+    }, uniqueConstraints = {
+        @UniqueConstraint(columnNames = {
+            "pk1"
+        })
+    })
+    protected int attribute11;
+
+    @Lob
+    protected int attribute12;
+
+    @Temporal(TemporalType.DATE)
+    protected int attribute13;
+
+    @Enumerated(value = EnumType.ORDINAL)
+    protected int attribute14;
+
+    @MapKey(name = "mk")
+    protected int attribute15;
+
+    @OrderBy(value = "x ASC")
+    protected int attribute16;
+
+    @AttributeOverrides( {
+            @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1")),
+            @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2"))
+    })
+    protected int attribute17;
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener1.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener1.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener1.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener1.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,113 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.PostLoad;
+import javax.persistence.PostPersist;
+import javax.persistence.PostRemove;
+import javax.persistence.PostUpdate;
+import javax.persistence.PrePersist;
+import javax.persistence.PreRemove;
+import javax.persistence.PreUpdate;
+
+public class MockEntityListener1 {
+    
+    public MockEntityListener1() {
+        // avoid eclipse warnings for unused private methods
+        prePersist(null);
+        postPersist(null);
+        preRemove(null);
+        postRemove(null);
+        preUpdate(null);
+        postUpdate(null);
+        postLoad(null);
+    }
+
+    @PrePersist
+    private void prePersist(Object entity) {
+
+    }
+
+    @PostPersist
+    private void postPersist(Object entity) {
+
+    }
+
+    @PreRemove
+    private void preRemove(Object entity) {
+
+    }
+
+    @PostRemove
+    private void postRemove(Object entity) {
+
+    }
+
+    @PreUpdate
+    private void preUpdate(Object entity) {
+
+    }
+
+    @PostUpdate
+    private void postUpdate(Object entity) {
+
+    }
+
+    @PostLoad
+    private void postLoad(Object entity) {
+
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener2.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener2.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener2.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityListener2.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,92 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.PostPersist;
+
+public class MockEntityListener2 {
+
+    // annotate only some methods...
+    
+    void prePersist(Object entity) {
+
+    }
+
+    @PostPersist
+    void postPersist(Object entity) {
+
+    }
+
+    void preRemove(Object entity) {
+
+    }
+
+    void postRemove(Object entity) {
+
+    }
+
+    void preUpdate(Object entity) {
+
+    }
+
+    void postUpdate(Object entity) {
+
+    }
+
+    void postLoad(Object entity) {
+
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap1.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap1.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap1.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap1.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,115 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.ColumnResult;
+import javax.persistence.EntityListeners;
+import javax.persistence.EntityResult;
+import javax.persistence.FieldResult;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.QueryHint;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.TableGenerator;
+import javax.persistence.UniqueConstraint;
+
+/**
+ * Annotations shared by the entore map.
+ * 
+ * @author Andrus Adamchik
+ */
+// TODO: andrus, 4/24/2006 - not sure if this is spec-compatible??? Spec seems to only
+// require processing of annotations on Entities, MappedSuperclasses and Embeddables,
+// however the schema supports globals - probably makes sense for us to support it too..
+@EntityListeners(value = {
+        MockEntityListener1.class, MockEntityListener2.class
+})
+@SequenceGenerator(name = "sg-name", sequenceName = "seq-name", initialValue = 5, allocationSize = 10)
+@NamedQueries( {
+        @NamedQuery(name = "query1", query = "select x", hints = {
+                @QueryHint(name = "hint1", value = "value1"),
+                @QueryHint(name = "hint2", value = "value2")
+        }), @NamedQuery(name = "query2", query = "select y")
+})
+@NamedNativeQueries( {
+        @NamedNativeQuery(name = "query3", query = "select z", resultClass = MockResultClass.class, resultSetMapping = "rs-mapping1", hints = {
+                @QueryHint(name = "hint3", value = "value3"),
+                @QueryHint(name = "hint4", value = "value4")
+        }), @NamedNativeQuery(name = "query4", query = "select a")
+})
+@SqlResultSetMapping(name = "result-map1", entities = {
+        @EntityResult(entityClass = MockEntityX.class, discriminatorColumn = "column1", fields = {
+                @FieldResult(name = "field1", column = "column1"),
+                @FieldResult(name = "field2", column = "column2")
+        }),
+        @EntityResult(entityClass = MockEntityY.class, discriminatorColumn = "column2", fields = {
+                @FieldResult(name = "field3", column = "column3"),
+                @FieldResult(name = "field4", column = "column4")
+        })
+}, columns = {
+        @ColumnResult(name = "column-result1"), @ColumnResult(name = "column-result2")
+})
+@TableGenerator(name = "table-generator", table = "auto_pk_table", catalog = "catalog1", schema = "schema1", pkColumnName = "next_id", valueColumnName = "x", pkColumnValue = "y", initialValue = 4, allocationSize = 20, uniqueConstraints = {
+    @UniqueConstraint(columnNames = {
+        "pk1"
+    })
+})
+public class MockEntityMap1 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap2.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap2.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap2.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityMap2.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,67 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.SequenceGenerator;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.TableGenerator;
+
+@SequenceGenerator(name = "sg-name2")
+@SqlResultSetMapping(name = "result-map2")
+@TableGenerator(name = "table-generator2")
+public class MockEntityMap2 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityX.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityX.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityX.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityX.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockEntityX {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityY.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityY.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityY.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockEntityY.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockEntityY {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockIdClass.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockIdClass.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockIdClass.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockIdClass.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockIdClass {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass1.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass1.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass1.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass1.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,125 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.Column;
+import javax.persistence.EntityListeners;
+import javax.persistence.ExcludeDefaultListeners;
+import javax.persistence.ExcludeSuperclassListeners;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.PostLoad;
+import javax.persistence.PostPersist;
+import javax.persistence.PostRemove;
+import javax.persistence.PostUpdate;
+import javax.persistence.PrePersist;
+import javax.persistence.PreRemove;
+import javax.persistence.PreUpdate;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+@MappedSuperclass
+@IdClass(MockIdClass.class)
+@ExcludeDefaultListeners
+@ExcludeSuperclassListeners
+@EntityListeners(value = {
+    MockEntityListener1.class
+})
+public class MockMappedSuperclass1 {
+    @Id
+    @Temporal(TemporalType.TIME)
+    @Column(name = "id_column", unique = true, nullable = true, insertable = true, updatable = true, table = "id_table", length = 3, precision = 4, scale = 5)
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "id-generator")
+    protected int id1;
+
+    @PrePersist
+    protected void eprePersist() {
+
+    }
+
+    @PostPersist
+    protected void epostPersist() {
+
+    }
+
+    @PreRemove
+    protected void epreRemove() {
+
+    }
+
+    @PostRemove
+    protected void epostRemove() {
+
+    }
+
+    @PreUpdate
+    protected void epreUpdate() {
+
+    }
+
+    @PostUpdate
+    protected void epostUpdate() {
+
+    }
+
+    @PostLoad
+    protected void epostLoad() {
+
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass2.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass2.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass2.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass2.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,73 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.MappedSuperclass;
+
+@MappedSuperclass
+public class MockMappedSuperclass2 {
+
+    @EmbeddedId
+    @AttributeOverrides(value = {
+            @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1")),
+            @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2"))
+    })
+    protected Object embeddedId;
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass3.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass3.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass3.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockMappedSuperclass3.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,154 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.Lob;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapKey;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.UniqueConstraint;
+import javax.persistence.Version;
+
+@MappedSuperclass
+public class MockMappedSuperclass3 {
+    @Basic
+    protected String attribute1;
+
+    @Version
+    protected int attribute2;
+
+    @OneToOne(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, optional = true, mappedBy = "mb1", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute3;
+
+    @OneToMany(targetEntity = MockTargetEntity2.class, fetch = FetchType.LAZY, mappedBy = "mb2", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute4;
+
+    @ManyToOne(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, optional = true, cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute5;
+
+    @ManyToMany(targetEntity = MockTargetEntity1.class, fetch = FetchType.LAZY, mappedBy = "mb4", cascade = {
+            CascadeType.MERGE, CascadeType.PERSIST
+    })
+    protected int attribute6;
+
+    @Embedded
+    protected int attribute7;
+
+    @Transient
+    protected int attribute8;
+
+    @Column(name = "column9")
+    protected int attribute9;
+
+    @JoinColumn(name = "join-column-10", referencedColumnName = "x-ref", unique = true, nullable = true, insertable = true, updatable = true, columnDefinition = "x-def", table = "jt1")
+    protected int attribute10;
+
+    @JoinTable(name = "jtable1", catalog = "catalog1", schema = "schema1", joinColumns = {
+            @JoinColumn(name = "join-column1"), @JoinColumn(name = "join-column2")
+    }, inverseJoinColumns = {
+            @JoinColumn(name = "ijoin-column1"), @JoinColumn(name = "ijoin-column2")
+    }, uniqueConstraints = {
+        @UniqueConstraint(columnNames = {
+            "pk1"
+        })
+    })
+    protected int attribute11;
+
+    @Lob
+    protected int attribute12;
+
+    @Temporal(TemporalType.DATE)
+    protected int attribute13;
+
+    @Enumerated(value = EnumType.ORDINAL)
+    protected int attribute14;
+
+    @MapKey(name = "mk")
+    protected int attribute15;
+
+    @OrderBy(value = "x ASC")
+    protected int attribute16;
+
+    @AttributeOverrides( {
+            @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1")),
+            @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2"))
+    })
+    protected int attribute17;
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockResultClass.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockResultClass.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockResultClass.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockResultClass.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockResultClass {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity1.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity1.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity1.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity1.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockTargetEntity1 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity2.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity2.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity2.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/entity/MockTargetEntity2.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,61 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.jpa.entity;
+
+
+public class MockTargetEntity2 {
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/JpaPersistenceUnitInfoTest.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,58 @@
+package org.objectstyle.cayenne.jpa.spi;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Collections;
+
+import javax.persistence.spi.PersistenceUnitTransactionType;
+
+import junit.framework.TestCase;
+
+public class JpaPersistenceUnitInfoTest extends TestCase {
+
+    public void testTransactionType() {
+        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+        info.addProperties(Collections.singletonMap(
+                JpaPersistenceProvider.TRANSACTION_TYPE_PROPERTY,
+                PersistenceUnitTransactionType.JTA.name()));
+        assertSame(PersistenceUnitTransactionType.JTA, info.getTransactionType());
+
+        info.addProperties(Collections.singletonMap(
+                JpaPersistenceProvider.TRANSACTION_TYPE_PROPERTY,
+                PersistenceUnitTransactionType.RESOURCE_LOCAL.name()));
+        assertSame(PersistenceUnitTransactionType.RESOURCE_LOCAL, info
+                .getTransactionType());
+    }
+
+    public void testClassLoader() {
+        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+
+        ClassLoader topLoader = new URLClassLoader(new URL[0], Thread
+                .currentThread()
+                .getContextClassLoader());
+        info.setClassLoader(topLoader);
+        assertSame(topLoader, info.getClassLoader());
+    }
+
+    public void testGetNewTempClassLoader() {
+        JpaPersistenceUnitInfo info = new JpaPersistenceUnitInfo();
+
+        ClassLoader topLoader = new URLClassLoader(new URL[0], Thread
+                .currentThread()
+                .getContextClassLoader());
+        info.setClassLoader(topLoader);
+
+        ClassLoader tmp1 = info.getNewTempClassLoader();
+        ClassLoader tmp2 = info.getNewTempClassLoader();
+        assertNotSame(topLoader, tmp1);
+        assertNotSame(topLoader, tmp2);
+        assertNotSame(tmp1, tmp2);
+
+        // presumably spec requirements that ".. scope and classpath of this loader is
+        // exactly the same as that of the loader returned by
+        // PersistenceUnitInfo.getClassLoader..." means that it has to be a child of the
+        // main ClassLoader
+        assertSame(topLoader, tmp1.getParent());
+        assertSame(topLoader, tmp2.getParent());
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockClassTransformer.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockClassTransformer.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockClassTransformer.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockClassTransformer.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,37 @@
+package org.objectstyle.cayenne.jpa.spi;
+
+import java.lang.instrument.IllegalClassFormatException;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.persistence.spi.ClassTransformer;
+
+/**
+ * A noop ClassTransformer that logs all classes that were passed through it.
+ * 
+ * @author Andrus Adamchik
+ */
+public class MockClassTransformer implements ClassTransformer {
+
+    protected Collection<String> transformed;
+
+    public MockClassTransformer() {
+        this.transformed = new ArrayList<String>();
+    }
+
+    public Collection getTransformed() {
+        return transformed;
+    }
+
+    public byte[] transform(
+            ClassLoader loader,
+            String className,
+            Class<?> classBeingRedefined,
+            ProtectionDomain protectionDomain,
+            byte[] classfileBuffer) throws IllegalClassFormatException {
+
+        transformed.add(className);
+        return null;
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockJpaDataSourceFactory.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockJpaDataSourceFactory.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockJpaDataSourceFactory.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockJpaDataSourceFactory.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,17 @@
+package org.objectstyle.cayenne.jpa.spi;
+
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.sql.DataSource;
+
+
+public class MockJpaDataSourceFactory implements JpaDataSourceFactory {
+
+    public DataSource getJtaDataSource(String name, PersistenceUnitInfo info) {
+        return null;
+    }
+
+    public DataSource getNonJtaDataSource(String name, PersistenceUnitInfo info) {
+        return null;
+    }
+
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceProvider.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceProvider.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceProvider.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceProvider.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,34 @@
+package org.objectstyle.cayenne.jpa.spi;
+
+import java.util.Map;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceUnitInfo;
+
+import org.objectstyle.cayenne.jpa.MockEntityManagerFactory;
+
+public class MockPersistenceProvider implements PersistenceProvider {
+
+    protected String unitName;
+
+    public MockPersistenceProvider() {
+
+    }
+
+    protected MockPersistenceProvider(String unitName) {
+        this.unitName = unitName;
+    }
+
+    public EntityManagerFactory createEntityManagerFactory(String emName, Map map) {
+        return unitName != null && unitName.equals(emName)
+                ? new MockEntityManagerFactory(emName, map)
+                : null;
+    }
+
+    public EntityManagerFactory createContainerManagerFactory(PersistenceUnitInfo info) {
+        return unitName != null && unitName.equals(info.getPersistenceUnitName())
+                ? new MockEntityManagerFactory(info.getPersistenceUnitName(), info)
+                : null;
+    }
+}

Added: incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceUnitInfo.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceUnitInfo.java?rev=396882&view=auto
==============================================================================
--- incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceUnitInfo.java (added)
+++ incubator/cayenne/trunk/cayenne-jpa/src/test/java/org/objectstyle/cayenne/jpa/spi/MockPersistenceUnitInfo.java Tue Apr 25 06:43:00 2006
@@ -0,0 +1,69 @@
+package org.objectstyle.cayenne.jpa.spi;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+
+import javax.persistence.spi.ClassTransformer;
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.persistence.spi.PersistenceUnitTransactionType;
+import javax.sql.DataSource;
+
+public class MockPersistenceUnitInfo implements PersistenceUnitInfo {
+
+    public String getPersistenceUnitName() {
+        return null;
+    }
+
+    public String getPersistenceProviderClassName() {
+        return null;
+    }
+
+    public PersistenceUnitTransactionType getTransactionType() {
+        return null;
+    }
+
+    public DataSource getJtaDataSource() {
+        return null;
+    }
+
+    public DataSource getNonJtaDataSource() {
+        return null;
+    }
+
+    public List<String> getMappingFileNames() {
+        return null;
+    }
+
+    public List<URL> getJarFileUrls() {
+        return null;
+    }
+
+    public URL getPersistenceUnitRootUrl() {
+        return null;
+    }
+
+    public List<String> getManagedClassNames() {
+        return null;
+    }
+
+    public boolean excludeUnlistedClasses() {
+        return false;
+    }
+
+    public Properties getProperties() {
+        return null;
+    }
+
+    public ClassLoader getClassLoader() {
+        return null;
+    }
+
+    public void addTransformer(ClassTransformer transformer) {
+    }
+
+    public ClassLoader getNewTempClassLoader() {
+        return null;
+    }
+
+}



Mime
View raw message