You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2006/08/30 21:07:17 UTC

svn commit: r438593 - in /incubator/cayenne/main/trunk/integration-test/jpa-unit1/src: main/java/org/apache/cayenne/jpa/itest1/entity/ main/resources/META-INF/ test/java/org/apache/cayenne/jpa/itest/entity/ test/resources/

Author: aadamchik
Date: Wed Aug 30 12:07:17 2006
New Revision: 438593

URL: http://svn.apache.org/viewvc?rev=438593&view=rev
Log:
mapping defaults itests

Added:
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EmbeddedImpliedEntity.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EnumType.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/NonSerializableType.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsInvalidEntity.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsOtherEntity.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsPrimitiveEntity.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/SerializableType.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_6_MappingDefaultsNonRelationshipTest.java
Modified:
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/resources/META-INF/persistence.xml
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_5_EmbeddableTest.java
    incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/resources/unit1-schema-hsqldb.sql

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EmbeddedImpliedEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EmbeddedImpliedEntity.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EmbeddedImpliedEntity.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EmbeddedImpliedEntity.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,40 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest1.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class EmbeddedImpliedEntity {
+
+    @Id
+    protected int id;
+
+    // @Embedded annotation is implied
+    protected Embeddable1 embeddable;
+
+    public Embeddable1 getEmbeddable() {
+        return embeddable;
+    }
+
+    public void setEmbeddable(Embeddable1 embeddable) {
+        this.embeddable = embeddable;
+    }
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EnumType.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EnumType.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EnumType.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/EnumType.java Wed Aug 30 12:07:17 2006
@@ -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.cayenne.jpa.itest1.entity;
+
+public enum EnumType {
+    a, b, c
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/NonSerializableType.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/NonSerializableType.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/NonSerializableType.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/NonSerializableType.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,32 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest1.entity;
+
+public class NonSerializableType {
+
+    protected String key;
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsInvalidEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsInvalidEntity.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsInvalidEntity.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsInvalidEntity.java Wed Aug 30 12:07:17 2006
@@ -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.cayenne.jpa.itest1.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class PropertyDefaultsInvalidEntity {
+
+    @Id
+    protected int id;
+
+    protected NonSerializableType invalidPersistenceProperty;
+
+    public void setInvalidPersistenceProperty(
+            NonSerializableType invalidPersistenceProperty) {
+        this.invalidPersistenceProperty = invalidPersistenceProperty;
+    }
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsOtherEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsOtherEntity.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsOtherEntity.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsOtherEntity.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,107 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest1.entity;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Time;
+import java.sql.Timestamp;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class PropertyDefaultsOtherEntity {
+
+    @Id
+    protected int id;
+
+    protected String string;
+    protected BigInteger bigInt;
+    protected BigDecimal bigDecimal;
+    protected java.util.Date utilDate;
+    protected java.util.Calendar calendar;
+    protected java.sql.Date sqlDate;
+    protected Time sqlTime;
+    protected Timestamp sqlTimestamp;
+
+    protected byte[] byteArray;
+    protected Byte[] byteWrapperArray;
+    protected char[] charArray;
+    protected Character[] charWrapperArray;
+
+    protected EnumType enumType;
+    protected SerializableType serializableType;
+
+    public void setBigDecimal(BigDecimal bigDecimal) {
+        this.bigDecimal = bigDecimal;
+    }
+
+    public void setBigInt(BigInteger bigInt) {
+        this.bigInt = bigInt;
+    }
+
+    public void setByteArray(byte[] byteArray) {
+        this.byteArray = byteArray;
+    }
+
+    public void setByteWrapperArray(Byte[] byteWrapperArray) {
+        this.byteWrapperArray = byteWrapperArray;
+    }
+
+    public void setCalendar(java.util.Calendar calendar) {
+        this.calendar = calendar;
+    }
+
+    public void setCharArray(char[] charArray) {
+        this.charArray = charArray;
+    }
+
+    public void setCharWrapperArray(Character[] charWrapperArray) {
+        this.charWrapperArray = charWrapperArray;
+    }
+
+    public void setEnumType(EnumType enumType) {
+        this.enumType = enumType;
+    }
+
+    public void setSerializableType(SerializableType serializableType) {
+        this.serializableType = serializableType;
+    }
+
+    public void setSqlDate(java.sql.Date sqlDate) {
+        this.sqlDate = sqlDate;
+    }
+
+    public void setSqlTime(Time sqlTime) {
+        this.sqlTime = sqlTime;
+    }
+
+    public void setSqlTimestamp(Timestamp sqlTimestamp) {
+        this.sqlTimestamp = sqlTimestamp;
+    }
+
+    public void setString(String string) {
+        this.string = string;
+    }
+
+    public void setUtilDate(java.util.Date utilDate) {
+        this.utilDate = utilDate;
+    }
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsPrimitiveEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsPrimitiveEntity.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsPrimitiveEntity.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/PropertyDefaultsPrimitiveEntity.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,112 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest1.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class PropertyDefaultsPrimitiveEntity {
+
+    @Id
+    protected int id;
+
+    protected boolean primitiveBoolean;
+    protected byte primitiveByte;
+    protected short primitiveShort;
+    protected int primitiveInt;
+    protected char primitiveChar;
+    protected long primitiveLong;
+    protected float primitiveFloat;
+    protected double primitiveDouble;
+
+    protected Boolean booleanWrapper;
+    protected Byte byteWrapper;
+    protected Short shortWrapper;
+    protected Integer intWrapper;
+    protected Character charWrapper;
+    protected Long longWrapper;
+    protected Float floatWrapper;
+    protected Double doubleWrapper;
+
+    public void setBooleanWrapper(Boolean booleanWrapper) {
+        this.booleanWrapper = booleanWrapper;
+    }
+
+    public void setByteWrapper(Byte byteWrapper) {
+        this.byteWrapper = byteWrapper;
+    }
+
+    public void setCharWrapper(Character charWrapper) {
+        this.charWrapper = charWrapper;
+    }
+
+    public void setDoubleWrapper(Double doubleWrapper) {
+        this.doubleWrapper = doubleWrapper;
+    }
+
+    public void setFloatWrapper(Float floatWrapper) {
+        this.floatWrapper = floatWrapper;
+    }
+
+    public void setIntWrapper(Integer intWrapper) {
+        this.intWrapper = intWrapper;
+    }
+
+    public void setLongWrapper(Long longWrapper) {
+        this.longWrapper = longWrapper;
+    }
+
+    public void setPrimitiveBoolean(boolean primitiveBoolean) {
+        this.primitiveBoolean = primitiveBoolean;
+    }
+
+    public void setPrimitiveByte(byte primitiveByte) {
+        this.primitiveByte = primitiveByte;
+    }
+
+    public void setPrimitiveChar(char primitiveChar) {
+        this.primitiveChar = primitiveChar;
+    }
+
+    public void setPrimitiveDouble(double primitiveDouble) {
+        this.primitiveDouble = primitiveDouble;
+    }
+
+    public void setPrimitiveFloat(float primitiveFloat) {
+        this.primitiveFloat = primitiveFloat;
+    }
+
+    public void setPrimitiveInt(int primitiveInt) {
+        this.primitiveInt = primitiveInt;
+    }
+
+    public void setPrimitiveLong(long primitiveLong) {
+        this.primitiveLong = primitiveLong;
+    }
+
+    public void setPrimitiveShort(short primitiveShort) {
+        this.primitiveShort = primitiveShort;
+    }
+
+    public void setShortWrapper(Short shortWrapper) {
+        this.shortWrapper = shortWrapper;
+    }
+
+}

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/SerializableType.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/SerializableType.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/SerializableType.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/java/org/apache/cayenne/jpa/itest1/entity/SerializableType.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,34 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest1.entity;
+
+import java.io.Serializable;
+
+public class SerializableType implements Serializable {
+
+    protected String key;
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+}

Modified: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/resources/META-INF/persistence.xml?rev=438593&r1=438592&r2=438593&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/resources/META-INF/persistence.xml (original)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/main/resources/META-INF/persistence.xml Wed Aug 30 12:07:17 2006
@@ -33,6 +33,9 @@
 		<class>org.apache.cayenne.jpa.itest1.entity.IdClassEntity</class>
 		<class>org.apache.cayenne.jpa.itest1.entity.EmbeddedIdEntity</class>
 		<class>org.apache.cayenne.jpa.itest1.entity.EmbeddedEntity</class>
-		<class>org.apache.cayenne.jpa.itest1.entity.Embeddable1</class>
+		<class>org.apache.cayenne.jpa.itest1.entity.EmbeddedImpliedEntity</class>
+		<class>org.apache.cayenne.jpa.itest1.entity.PropertyDefaultsPrimitiveEntity</class>
+		<class>org.apache.cayenne.jpa.itest1.entity.PropertyDefaultsOtherEntity</class>
+		<class>org.apache.cayenne.jpa.itest1.entity.PropertyDefaultsInvalidEntity</class>
 	</persistence-unit>
 </persistence>

Modified: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_5_EmbeddableTest.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_5_EmbeddableTest.java?rev=438593&r1=438592&r2=438593&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_5_EmbeddableTest.java (original)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_5_EmbeddableTest.java Wed Aug 30 12:07:17 2006
@@ -19,12 +19,15 @@
 package org.apache.cayenne.jpa.itest.entity;
 
 import org.apache.cayenne.jpa.itest.EntityManagerCase;
+import org.apache.cayenne.jpa.itest.ItestDBUtils;
 import org.apache.cayenne.jpa.itest1.entity.Embeddable1;
 import org.apache.cayenne.jpa.itest1.entity.EmbeddedEntity;
 
 public class _2_1_5_EmbeddableTest extends EntityManagerCase {
 
     public void testEmbeddable() throws Exception {
+        ItestDBUtils.deleteAll("EmbeddedEntity");
+        
         EmbeddedEntity o1 = new EmbeddedEntity();
         Embeddable1 o2 = new Embeddable1();
         o2.setProperty1("p1");

Added: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_6_MappingDefaultsNonRelationshipTest.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_6_MappingDefaultsNonRelationshipTest.java?rev=438593&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_6_MappingDefaultsNonRelationshipTest.java (added)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/java/org/apache/cayenne/jpa/itest/entity/_2_1_6_MappingDefaultsNonRelationshipTest.java Wed Aug 30 12:07:17 2006
@@ -0,0 +1,65 @@
+/*****************************************************************
+ *   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.cayenne.jpa.itest.entity;
+
+import org.apache.cayenne.jpa.itest.EntityManagerCase;
+import org.apache.cayenne.jpa.itest.ItestDBUtils;
+import org.apache.cayenne.jpa.itest1.entity.Embeddable1;
+import org.apache.cayenne.jpa.itest1.entity.EmbeddedImpliedEntity;
+import org.apache.cayenne.jpa.itest1.entity.PropertyDefaultsPrimitiveEntity;
+
+public class _2_1_6_MappingDefaultsNonRelationshipTest extends EntityManagerCase {
+
+    public void testEmbeddedDefault() throws Exception {
+        ItestDBUtils.deleteAll("EmbeddedImpliedEntity");
+
+        EmbeddedImpliedEntity o1 = new EmbeddedImpliedEntity();
+        Embeddable1 o2 = new Embeddable1();
+        o2.setProperty1("p1");
+        o1.setEmbeddable(o2);
+
+        getEntityManager().persist(o1);
+        getEntityManager().getTransaction().commit();
+
+        // TODO: andrus 8/10/2006 - fails
+        // assertEquals("p1", ItestDBUtils.getSingleValue(
+        // "EmbeddedImpliedEntity",
+        // "property1"));
+    }
+
+    // TODO: andrus 8/10/2006 - fails
+    public void _testPrimitiveDefaults() throws Exception {
+        ItestDBUtils.deleteAll("PropertyDefaultsPrimitiveEntity");
+
+        PropertyDefaultsPrimitiveEntity o1 = new PropertyDefaultsPrimitiveEntity();
+        o1.setPrimitiveBoolean(true);
+        o1.setBooleanWrapper(Boolean.TRUE);
+
+        getEntityManager().persist(o1);
+        getEntityManager().getTransaction().commit();
+
+        // TODO: andrus 8/10/2006 - fails
+        assertTrue(ItestDBUtils.getSingleBoolean(
+                "PropertyDefaultsPrimitiveEntity",
+                "primitiveBoolean"));
+        assertTrue(ItestDBUtils.getSingleBoolean(
+                "PropertyDefaultsPrimitiveEntity",
+                "booleanWrapper"));
+    }
+}

Modified: incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/resources/unit1-schema-hsqldb.sql
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/resources/unit1-schema-hsqldb.sql?rev=438593&r1=438592&r2=438593&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/resources/unit1-schema-hsqldb.sql (original)
+++ incubator/cayenne/main/trunk/integration-test/jpa-unit1/src/test/resources/unit1-schema-hsqldb.sql Wed Aug 30 12:07:17 2006
@@ -8,6 +8,8 @@
 insert into AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('HelperEntity3', 1);
 insert into AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('HelperEntity4', 1);
 insert into AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('EmbeddedEntity', 1);
+insert into AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('EmbeddedImpliedEntity', 1);
+insert into AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PropertyDefaultsPrimitiveEntity', 1);
 
 create table FieldPersistenceEntity (id int not null, property1 VARCHAR(100), primary key(id));
 create table PropertyPersistenceEntity (id int not null, property1 VARCHAR(100), property2 BOOLEAN, primary key(id));
@@ -20,4 +22,7 @@
 create table NoPkEntity (property1 VARCHAR(100));
 create table IdClassEntity (id1 int not null, id2 int not null, property1 VARCHAR(100), primary key(id1, id2));
 create table EmbeddedIdEntity (id1 int not null, id2 int not null, property1 VARCHAR(100), primary key(id1, id2));
-create table EmbeddedEntity (id int not null, property1 VARCHAR(100), primary key(id));
\ No newline at end of file
+create table EmbeddedEntity (id int not null, property1 VARCHAR(100), primary key(id));
+create table EmbeddedImpliedEntity (id int not null, property1 VARCHAR(100), primary key(id));
+create table PropertyDefaultsPrimitiveEntity (id INT not null, primitiveBoolean BOOLEAN, primitiveByte TINYINT, primitiveShort SMALLINT, primitiveChar CHAR(1), primitiveLong BIGINT, primitiveFloat FLOAT, primitiveDouble DOUBLE, booleanWrapper BOOLEAN, byteWrapper TINYINT, shortWrapper SMALLINT, charWrapper CHAR(1), longWrapper BIGINT, floatWrapper FLOAT, doubleWrapper DOUBLE, primary key(id));
+create table PropertyDefaultsOtherEntity (id int not null, string VARCHAR(100), bigInt BIGINT, bigDecimal NUMERIC, utilDate TIMESTAMP, calendar TIMESTAMP, sqlDate DATE, sqlTime TIME, sqlTimestamp TIMESTAMP, byteArray VARBINARY(100), byteWrapperArray VARBINARY(100), charArray VARCHAR(100), charWrapperArray VARCHAR(100), enumType INT, serializableType VARBINARY(200), primary key(id));
\ No newline at end of file