You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2009/03/23 00:45:35 UTC
svn commit: r757280 [19/23] - in /openjpa/branches/1.0.x:
openjpa-examples/src/main/java/hellojpa/
openjpa-examples/src/main/java/relations/
openjpa-jdbc-5/src/main/java/org/apache/openjpa/jdbc/meta/strats/
openjpa-jdbc/src/main/java/org/apache/openjpa...
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/BasicEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyChild.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyChild.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyChild.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyChild.java Sun Mar 22 23:45:15 2009
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-import org.apache.openjpa.persistence.jdbc.ForeignKey;
-
-@Entity
-public class CascadingOneManyChild {
-
- @Id
- @GeneratedValue
- private long id;
-
- private String name;
-
- @ManyToOne(optional=false)
- @JoinColumn(name="PARENT_ID", nullable=false)
- @ForeignKey
- private CascadingOneManyParent parent;
-
- @Version
- private Integer optLock;
-
- public long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public CascadingOneManyParent getParent() {
- return parent;
- }
-
- public void setParent(CascadingOneManyParent parent) {
- this.parent = parent;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.jdbc.ForeignKey;
+
+@Entity
+public class CascadingOneManyChild {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ @ManyToOne(optional=false)
+ @JoinColumn(name="PARENT_ID", nullable=false)
+ @ForeignKey
+ private CascadingOneManyParent parent;
+
+ @Version
+ private Integer optLock;
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public CascadingOneManyParent getParent() {
+ return parent;
+ }
+
+ public void setParent(CascadingOneManyParent parent) {
+ this.parent = parent;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyChild.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyParent.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyParent.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyParent.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyParent.java Sun Mar 22 23:45:15 2009
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Version;
-
-@Entity
-public class CascadingOneManyParent {
-
- @Id
- @GeneratedValue
- private long id;
-
- private String name;
-
- @OneToMany(mappedBy="parent", cascade=CascadeType.ALL)
- @OrderBy("name ASC")
- private List<CascadingOneManyChild> children =
- new ArrayList<CascadingOneManyChild>();
-
- @Version
- private Integer optLock;
-
- public long getId() {
- return id;
- }
-
- public List<CascadingOneManyChild> getChildren() {
- return children;
- }
-
- public void addChild(CascadingOneManyChild child) {
- child.setParent(this);
- children.add(child);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Version;
+
+@Entity
+public class CascadingOneManyParent {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ @OneToMany(mappedBy="parent", cascade=CascadeType.ALL)
+ @OrderBy("name ASC")
+ private List<CascadingOneManyChild> children =
+ new ArrayList<CascadingOneManyChild>();
+
+ @Version
+ private Integer optLock;
+
+ public long getId() {
+ return id;
+ }
+
+ public List<CascadingOneManyChild> getChildren() {
+ return children;
+ }
+
+ public void addChild(CascadingOneManyChild child) {
+ child.setParent(this);
+ children.add(child);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/CascadingOneManyParent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreBasicEntity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreBasicEntity.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreBasicEntity.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreBasicEntity.java Sun Mar 22 23:45:15 2009
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-import org.apache.openjpa.persistence.DataStoreId;
-
-@Entity
-@DataStoreId
-public class DataStoreBasicEntity {
-
- private String name;
-
- @ManyToOne
- private BasicEntity rel;
-
- @Version
- private Integer optLock;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public BasicEntity getRel() {
- return rel;
- }
-
- public void setRel(BasicEntity rel) {
- this.rel = rel;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Entity;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.DataStoreId;
+
+@Entity
+@DataStoreId
+public class DataStoreBasicEntity {
+
+ private String name;
+
+ @ManyToOne
+ private BasicEntity rel;
+
+ @Version
+ private Integer optLock;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public BasicEntity getRel() {
+ return rel;
+ }
+
+ public void setRel(BasicEntity rel) {
+ this.rel = rel;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreBasicEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreManyOneIdOwner.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreManyOneIdOwner.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreManyOneIdOwner.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreManyOneIdOwner.java Sun Mar 22 23:45:15 2009
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-@Entity
-public class DataStoreManyOneIdOwner {
-
- @Id
- @ManyToOne
- private DataStoreBasicEntity id;
-
- private String name;
-
- @ManyToOne
- private DataStoreManyOneIdOwner selfRel;
-
- @Version
- private Integer optLock;
-
- public DataStoreBasicEntity getId() {
- return id;
- }
-
- public void setId(DataStoreBasicEntity id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public DataStoreManyOneIdOwner getSelfRel() {
- return selfRel;
- }
-
- public void setSelfRel(DataStoreManyOneIdOwner selfRel) {
- this.selfRel = selfRel;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+@Entity
+public class DataStoreManyOneIdOwner {
+
+ @Id
+ @ManyToOne
+ private DataStoreBasicEntity id;
+
+ private String name;
+
+ @ManyToOne
+ private DataStoreManyOneIdOwner selfRel;
+
+ @Version
+ private Integer optLock;
+
+ public DataStoreBasicEntity getId() {
+ return id;
+ }
+
+ public void setId(DataStoreBasicEntity id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public DataStoreManyOneIdOwner getSelfRel() {
+ return selfRel;
+ }
+
+ public void setSelfRel(DataStoreManyOneIdOwner selfRel) {
+ this.selfRel = selfRel;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/DataStoreManyOneIdOwner.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EmbeddableWithRelation.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EmbeddableWithRelation.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EmbeddableWithRelation.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EmbeddableWithRelation.java Sun Mar 22 23:45:15 2009
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Embeddable;
-import javax.persistence.CascadeType;
-import javax.persistence.ManyToOne;
-
-@Embeddable
-public class EmbeddableWithRelation {
-
- private String name;
-
- @ManyToOne(cascade=CascadeType.ALL)
- private MultipleSameTypedEmbedded rel;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public MultipleSameTypedEmbedded getRel() {
- return rel;
- }
-
- public void setRel(MultipleSameTypedEmbedded rel) {
- this.rel = rel;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Embeddable;
+import javax.persistence.CascadeType;
+import javax.persistence.ManyToOne;
+
+@Embeddable
+public class EmbeddableWithRelation {
+
+ private String name;
+
+ @ManyToOne(cascade=CascadeType.ALL)
+ private MultipleSameTypedEmbedded rel;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public MultipleSameTypedEmbedded getRel() {
+ return rel;
+ }
+
+ public void setRel(MultipleSameTypedEmbedded rel) {
+ this.rel = rel;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/EmbeddableWithRelation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/IFace.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwner.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwner.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwner.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwner.java Sun Mar 22 23:45:15 2009
@@ -1,75 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-@Entity
-@IdClass(ManyOneCompoundIdOwnerId.class)
-public class ManyOneCompoundIdOwner {
-
- @Id
- @GeneratedValue
- private long longId;
-
- @Id
- @ManyToOne
- private BasicEntity entityId;
-
- private String name;
-
- @ManyToOne
- private ManyOneCompoundIdOwner selfRel;
-
- @Version
- private Integer optLock;
-
- public long getLongId() {
- return longId;
- }
-
- public BasicEntity getEntityId() {
- return entityId;
- }
-
- public void setEntityId(BasicEntity entityId) {
- this.entityId = entityId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public ManyOneCompoundIdOwner getSelfRel() {
- return selfRel;
- }
-
- public void setSelfRel(ManyOneCompoundIdOwner selfRel) {
- this.selfRel = selfRel;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+@Entity
+@IdClass(ManyOneCompoundIdOwnerId.class)
+public class ManyOneCompoundIdOwner {
+
+ @Id
+ @GeneratedValue
+ private long longId;
+
+ @Id
+ @ManyToOne
+ private BasicEntity entityId;
+
+ private String name;
+
+ @ManyToOne
+ private ManyOneCompoundIdOwner selfRel;
+
+ @Version
+ private Integer optLock;
+
+ public long getLongId() {
+ return longId;
+ }
+
+ public BasicEntity getEntityId() {
+ return entityId;
+ }
+
+ public void setEntityId(BasicEntity entityId) {
+ this.entityId = entityId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ManyOneCompoundIdOwner getSelfRel() {
+ return selfRel;
+ }
+
+ public void setSelfRel(ManyOneCompoundIdOwner selfRel) {
+ this.selfRel = selfRel;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwner.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneCompoundIdOwnerId.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneIdOwner.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneIdOwner.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneIdOwner.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneIdOwner.java Sun Mar 22 23:45:15 2009
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-@Entity
-public class ManyOneIdOwner {
-
- @Id
- @ManyToOne
- private BasicEntity id;
-
- private String name;
-
- @ManyToOne
- private ManyOneIdOwner selfRel;
-
- @Version
- private Integer optLock;
-
- public BasicEntity getId() {
- return id;
- }
-
- public void setId(BasicEntity id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public ManyOneIdOwner getSelfRel() {
- return selfRel;
- }
-
- public void setSelfRel(ManyOneIdOwner selfRel) {
- this.selfRel = selfRel;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+@Entity
+public class ManyOneIdOwner {
+
+ @Id
+ @ManyToOne
+ private BasicEntity id;
+
+ private String name;
+
+ @ManyToOne
+ private ManyOneIdOwner selfRel;
+
+ @Version
+ private Integer optLock;
+
+ public BasicEntity getId() {
+ return id;
+ }
+
+ public void setId(BasicEntity id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ManyOneIdOwner getSelfRel() {
+ return selfRel;
+ }
+
+ public void setSelfRel(ManyOneIdOwner selfRel) {
+ this.selfRel = selfRel;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ManyOneIdOwner.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/MultipleSameTypedEmbedded.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/MultipleSameTypedEmbedded.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/MultipleSameTypedEmbedded.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/MultipleSameTypedEmbedded.java Sun Mar 22 23:45:15 2009
@@ -1,80 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.AttributeOverride;
-import javax.persistence.AssociationOverride;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.Version;
-
-@Entity
-public class MultipleSameTypedEmbedded {
-
- @Id
- @GeneratedValue
- private long id;
-
- private String name;
-
- @Embedded
- @AttributeOverride(name="name", column=@Column(name="E1_NAME"))
- @AssociationOverride(name="rel", joinColumns=@JoinColumn(name="E1_REL"))
- private EmbeddableWithRelation embed1;
-
- @Embedded
- @AttributeOverride(name="name", column=@Column(name="E2_NAME"))
- @AssociationOverride(name="rel", joinColumns=@JoinColumn(name="E2_REL"))
- private EmbeddableWithRelation embed2;
-
- @Version
- private Integer optLock;
-
- public long getId() {
- return id;
- }
-
- public EmbeddableWithRelation getEmbed1() {
- return embed1;
- }
-
- public void setEmbed1(EmbeddableWithRelation embed1) {
- this.embed1 = embed1;
- }
-
- public EmbeddableWithRelation getEmbed2() {
- return embed2;
- }
-
- public void setEmbed2(EmbeddableWithRelation embed2) {
- this.embed2 = embed2;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AssociationOverride;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Version;
+
+@Entity
+public class MultipleSameTypedEmbedded {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ @Embedded
+ @AttributeOverride(name="name", column=@Column(name="E1_NAME"))
+ @AssociationOverride(name="rel", joinColumns=@JoinColumn(name="E1_REL"))
+ private EmbeddableWithRelation embed1;
+
+ @Embedded
+ @AttributeOverride(name="name", column=@Column(name="E2_NAME"))
+ @AssociationOverride(name="rel", joinColumns=@JoinColumn(name="E2_REL"))
+ private EmbeddableWithRelation embed2;
+
+ @Version
+ private Integer optLock;
+
+ public long getId() {
+ return id;
+ }
+
+ public EmbeddableWithRelation getEmbed1() {
+ return embed1;
+ }
+
+ public void setEmbed1(EmbeddableWithRelation embed1) {
+ this.embed1 = embed1;
+ }
+
+ public EmbeddableWithRelation getEmbed2() {
+ return embed2;
+ }
+
+ public void setEmbed2(EmbeddableWithRelation embed2) {
+ this.embed2 = embed2;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/MultipleSameTypedEmbedded.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TargetedIFaceRelationParent.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TargetedIFaceRelationParent.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TargetedIFaceRelationParent.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TargetedIFaceRelationParent.java Sun Mar 22 23:45:15 2009
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Version;
-
-@Entity
-public class TargetedIFaceRelationParent
- implements IFace {
-
- @Id
- @GeneratedValue
- private long id;
-
- private String name;
-
- @ManyToOne(targetEntity=TargetedIFaceRelationParent.class,
- cascade=CascadeType.ALL)
- private IFace iface;
-
- @Version
- private Integer optLock;
-
- public long getId() {
- return id;
- }
-
- public IFace getIFace() {
- return iface;
- }
-
- public void setIFace(IFace iface) {
- this.iface = iface;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Version;
+
+@Entity
+public class TargetedIFaceRelationParent
+ implements IFace {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ @ManyToOne(targetEntity=TargetedIFaceRelationParent.class,
+ cascade=CascadeType.ALL)
+ private IFace iface;
+
+ @Version
+ private Integer optLock;
+
+ public long getId() {
+ return id;
+ }
+
+ public IFace getIFace() {
+ return iface;
+ }
+
+ public void setIFace(IFace iface) {
+ this.iface = iface;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TargetedIFaceRelationParent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestBulkUpdatesAndEmbeddedFields.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestBulkUpdatesAndEmbeddedFields.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestBulkUpdatesAndEmbeddedFields.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestBulkUpdatesAndEmbeddedFields.java Sun Mar 22 23:45:15 2009
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.relations;
-
-import org.apache.openjpa.persistence.test.SingleEMTestCase;
-
-/**
- * Tests OPENJPA-199
- */
-public class TestBulkUpdatesAndEmbeddedFields
- extends SingleEMTestCase {
-
- public void setUp() {
- setUp(MultipleSameTypedEmbedded.class, EmbeddableWithRelation.class,
- CLEAR_TABLES);
-
- em.getTransaction().begin();
- MultipleSameTypedEmbedded pc = new MultipleSameTypedEmbedded();
- pc.setEmbed1(new EmbeddableWithRelation());
- pc.getEmbed1().setName("foo");
- em.persist(pc);
- em.getTransaction().commit();
- }
-
- public void testBulkUpdateOfEmbeddedField() {
- em.getTransaction().begin();
- assertEquals(1, em.createQuery(
- "UPDATE MultipleSameTypedEmbedded o SET o.embed1.name = 'bar'")
- .executeUpdate());
- em.getTransaction().commit();
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.relations;
+
+import org.apache.openjpa.persistence.test.SingleEMTestCase;
+
+/**
+ * Tests OPENJPA-199
+ */
+public class TestBulkUpdatesAndEmbeddedFields
+ extends SingleEMTestCase {
+
+ public void setUp() {
+ setUp(MultipleSameTypedEmbedded.class, EmbeddableWithRelation.class,
+ CLEAR_TABLES);
+
+ em.getTransaction().begin();
+ MultipleSameTypedEmbedded pc = new MultipleSameTypedEmbedded();
+ pc.setEmbed1(new EmbeddableWithRelation());
+ pc.getEmbed1().setName("foo");
+ em.persist(pc);
+ em.getTransaction().commit();
+ }
+
+ public void testBulkUpdateOfEmbeddedField() {
+ em.getTransaction().begin();
+ assertEquals(1, em.createQuery(
+ "UPDATE MultipleSameTypedEmbedded o SET o.embed1.name = 'bar'")
+ .executeUpdate());
+ em.getTransaction().commit();
+ }
}
\ No newline at end of file
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestBulkUpdatesAndEmbeddedFields.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestCascadingOneManyWithForeignKey.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestManyOneAsId.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestMultipleSameTypedEmbeddedWithEagerRelations.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestTargetedIFaceRelations.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/AllFieldTypes.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java Sun Mar 22 23:45:15 2009
@@ -1,49 +1,49 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.simple;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Version;
-
-@Entity(name="named")
-public class NamedEntity {
-
- @Id
- @GeneratedValue
- private long id;
-
- private String name;
-
- @Version
- private Integer optLock;
-
- public long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.simple;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Version;
+
+@Entity(name="named")
+public class NamedEntity {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ @Version
+ private Integer optLock;
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestBasicAnnotation.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestBasicAnnotation.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestBasicAnnotation.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestBasicAnnotation.java Sun Mar 22 23:45:15 2009
@@ -1,92 +1,92 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.simple;
-
-import java.math.BigDecimal;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.persistence.EntityManager;
-
-import junit.textui.TestRunner;
-import org.apache.openjpa.persistence.test.SingleEMFTestCase;
-
-/**
- * Simple test case to test the default values associated with the @Basic
- * annotation.
- *
- * @author Kevin Sutter
- */
-public class TestBasicAnnotation
- extends SingleEMFTestCase {
-
- public void setUp() {
- setUp(CLEAR_TABLES, AllFieldTypes.class);
- }
-
- public void testEagerFetchType() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- AllFieldTypes aft = new AllFieldTypes();
-
- // Initialize a sampling of the types
- aft.setBigDecimalField(new BigDecimal(1));
- aft.setBooleanField(false);
- aft.setByteLob(new byte[1]);
- aft.setCalendarField(Calendar.getInstance());
- aft.setDateField(new Date());
- aft.setEnumField(AllFieldTypes.EnumType.Value1);
- aft.setSerializableField(new Date());
- aft.setSqlTimestampField(new java.sql.Timestamp(
- System.currentTimeMillis()));
- aft.setStringField("aft");
- aft.setWByteLob(new Byte[1]);
- aft.setWDoubleField(new Double(1));
-
- em.persist(aft);
- em.getTransaction().commit();
- em.clear();
-
- AllFieldTypes aftQuery = (AllFieldTypes)em.createQuery
- ("select x from AllFieldTypes x where x.stringField = 'aft'").
- getSingleResult();
- em.clear(); // ensure detached
- assertFalse(em.contains(aftQuery));
-
- // assert that the sampling of fields are not null
- assertNotNull(aftQuery.getBigDecimalField());
- assertNotNull(aftQuery.getBooleanField());
- assertNotNull(aftQuery.getByteLob());
- assertNotNull(aftQuery.getCalendarField());
- assertNotNull(aftQuery.getDateField());
- assertNotNull(aftQuery.getEnumField());
- assertNotNull(aftQuery.getSerializableField());
- assertNotNull(aftQuery.getSqlTimestampField());
- assertNotNull(aftQuery.getStringField());
- assertNotNull(aftQuery.getWByteLob());
- assertNotNull(aftQuery.getWDoubleField());
-
- em.close();
- }
-
- public static void main(String[] args) {
- TestRunner.run(TestBasicAnnotation.class);
- }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.simple;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.persistence.EntityManager;
+
+import junit.textui.TestRunner;
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+
+/**
+ * Simple test case to test the default values associated with the @Basic
+ * annotation.
+ *
+ * @author Kevin Sutter
+ */
+public class TestBasicAnnotation
+ extends SingleEMFTestCase {
+
+ public void setUp() {
+ setUp(CLEAR_TABLES, AllFieldTypes.class);
+ }
+
+ public void testEagerFetchType() {
+ EntityManager em = emf.createEntityManager();
+ em.getTransaction().begin();
+ AllFieldTypes aft = new AllFieldTypes();
+
+ // Initialize a sampling of the types
+ aft.setBigDecimalField(new BigDecimal(1));
+ aft.setBooleanField(false);
+ aft.setByteLob(new byte[1]);
+ aft.setCalendarField(Calendar.getInstance());
+ aft.setDateField(new Date());
+ aft.setEnumField(AllFieldTypes.EnumType.Value1);
+ aft.setSerializableField(new Date());
+ aft.setSqlTimestampField(new java.sql.Timestamp(
+ System.currentTimeMillis()));
+ aft.setStringField("aft");
+ aft.setWByteLob(new Byte[1]);
+ aft.setWDoubleField(new Double(1));
+
+ em.persist(aft);
+ em.getTransaction().commit();
+ em.clear();
+
+ AllFieldTypes aftQuery = (AllFieldTypes)em.createQuery
+ ("select x from AllFieldTypes x where x.stringField = 'aft'").
+ getSingleResult();
+ em.clear(); // ensure detached
+ assertFalse(em.contains(aftQuery));
+
+ // assert that the sampling of fields are not null
+ assertNotNull(aftQuery.getBigDecimalField());
+ assertNotNull(aftQuery.getBooleanField());
+ assertNotNull(aftQuery.getByteLob());
+ assertNotNull(aftQuery.getCalendarField());
+ assertNotNull(aftQuery.getDateField());
+ assertNotNull(aftQuery.getEnumField());
+ assertNotNull(aftQuery.getSerializableField());
+ assertNotNull(aftQuery.getSqlTimestampField());
+ assertNotNull(aftQuery.getStringField());
+ assertNotNull(aftQuery.getWByteLob());
+ assertNotNull(aftQuery.getWDoubleField());
+
+ em.close();
+ }
+
+ public static void main(String[] args) {
+ TestRunner.run(TestBasicAnnotation.class);
+ }
+}
+
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestBasicAnnotation.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java Sun Mar 22 23:45:15 2009
@@ -1,115 +1,115 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.simple;
-
-import javax.persistence.EntityManager;
-
-import junit.textui.TestRunner;
-import org.apache.openjpa.persistence.test.SingleEMTestCase;
-
-/**
- * Test case to ensure that the proper JPA merge semantics are processed.
- *
- * @author Kevin Sutter
- */
-public class TestEntityManagerMerge
- extends SingleEMTestCase {
-
- public void setUp() {
- setUp(AllFieldTypes.class, Person.class);
- }
-
- public void testMerge() {
- // Create EntityManager and Start a transaction (1)
- begin();
-
- // Insert a new object into the PC
- AllFieldTypes testObject = new AllFieldTypes();
- testObject.setStringField("new test object");
- persist(testObject);
- assertTrue("testObject not found in pc", em.contains(testObject));
-
- // Modify this object...
- testObject.setStringField("updated test object");
-
- // Attempt to merge this updated object into the PC. Should be ignored.
- AllFieldTypes mergedObject = em.merge(testObject);
- assertTrue("mergedObject and testObject are not equal",
- mergedObject.equals(testObject));
- assertTrue("mergedObject and testObject are not ==",
- mergedObject == testObject);
- assertTrue("testObject not found in pc", em.contains(testObject));
- assertTrue("mergedObject not found in pc", em.contains(mergedObject));
-
- // And, once again...
- testObject.setStringField("yet another update");
- AllFieldTypes mergedObject2 = em.merge(testObject);
- assertTrue("mergedObject2 and testObject are not equal",
- mergedObject2.equals(testObject));
- assertTrue("mergedObject2 and testObject are not ==",
- mergedObject2 == testObject);
- assertTrue("testObject not found in pc", em.contains(testObject));
- assertTrue("mergedObject2 not found in pc", em.contains(mergedObject2));
-
- // Rollback
- rollback();
-
- }
-
- /**
- * This test verifies that persisting a new entity which matches an existing
- * row in the database succeeds.
- */
- public void testMergeExistingEntity() {
- Person p = new Person();
- p.setId(102);
-
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.persist(p);
- em.getTransaction().commit();
- em.close();
-
- em = emf.createEntityManager();
- p = new Person();
- p.setId(102);
- p.setForename("Jane");
-
- em.getTransaction().begin();
- em.merge(p);
- em.getTransaction().commit();
-
- em.close();
-
- em = emf.createEntityManager();
- p = (Person) em.createQuery("Select p from Person p where p.id = 102")
- .getSingleResult();
-
- assertNotNull(p);
- assertEquals("Jane", p.getForename());
-
- em.close();
- }
-
- public static void main(String[] args) {
- TestRunner.run(TestEntityManagerMerge.class);
- }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.simple;
+
+import javax.persistence.EntityManager;
+
+import junit.textui.TestRunner;
+import org.apache.openjpa.persistence.test.SingleEMTestCase;
+
+/**
+ * Test case to ensure that the proper JPA merge semantics are processed.
+ *
+ * @author Kevin Sutter
+ */
+public class TestEntityManagerMerge
+ extends SingleEMTestCase {
+
+ public void setUp() {
+ setUp(AllFieldTypes.class, Person.class);
+ }
+
+ public void testMerge() {
+ // Create EntityManager and Start a transaction (1)
+ begin();
+
+ // Insert a new object into the PC
+ AllFieldTypes testObject = new AllFieldTypes();
+ testObject.setStringField("new test object");
+ persist(testObject);
+ assertTrue("testObject not found in pc", em.contains(testObject));
+
+ // Modify this object...
+ testObject.setStringField("updated test object");
+
+ // Attempt to merge this updated object into the PC. Should be ignored.
+ AllFieldTypes mergedObject = em.merge(testObject);
+ assertTrue("mergedObject and testObject are not equal",
+ mergedObject.equals(testObject));
+ assertTrue("mergedObject and testObject are not ==",
+ mergedObject == testObject);
+ assertTrue("testObject not found in pc", em.contains(testObject));
+ assertTrue("mergedObject not found in pc", em.contains(mergedObject));
+
+ // And, once again...
+ testObject.setStringField("yet another update");
+ AllFieldTypes mergedObject2 = em.merge(testObject);
+ assertTrue("mergedObject2 and testObject are not equal",
+ mergedObject2.equals(testObject));
+ assertTrue("mergedObject2 and testObject are not ==",
+ mergedObject2 == testObject);
+ assertTrue("testObject not found in pc", em.contains(testObject));
+ assertTrue("mergedObject2 not found in pc", em.contains(mergedObject2));
+
+ // Rollback
+ rollback();
+
+ }
+
+ /**
+ * This test verifies that persisting a new entity which matches an existing
+ * row in the database succeeds.
+ */
+ public void testMergeExistingEntity() {
+ Person p = new Person();
+ p.setId(102);
+
+ EntityManager em = emf.createEntityManager();
+
+ em.getTransaction().begin();
+ em.persist(p);
+ em.getTransaction().commit();
+ em.close();
+
+ em = emf.createEntityManager();
+ p = new Person();
+ p.setId(102);
+ p.setForename("Jane");
+
+ em.getTransaction().begin();
+ em.merge(p);
+ em.getTransaction().commit();
+
+ em.close();
+
+ em = emf.createEntityManager();
+ p = (Person) em.createQuery("Select p from Person p where p.id = 102")
+ .getSingleResult();
+
+ assertNotNull(p);
+ assertEquals("Jane", p.getForename());
+
+ em.close();
+ }
+
+ public static void main(String[] args) {
+ TestRunner.run(TestEntityManagerMerge.class);
+ }
+}
+
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerMerge.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestFlushBeforeDetach.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java Sun Mar 22 23:45:15 2009
@@ -1,94 +1,94 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence.simple;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-
-import junit.textui.TestRunner;
-import org.apache.openjpa.persistence.OpenJPAEntityManager;
-import org.apache.openjpa.persistence.test.SingleEMFTestCase;
-
-/**
- * Simple test case to get an EntityManager and perform some basic operations.
- *
- * @author Marc Prud'hommeaux
- */
-public class TestPersistence
- extends SingleEMFTestCase {
-
- public void setUp() {
- setUp(AllFieldTypes.class);
- }
-
- public void testCreateEntityManager() {
- EntityManager em = emf.createEntityManager();
-
- EntityTransaction t = em.getTransaction();
- assertNotNull(t);
- t.begin();
- t.setRollbackOnly();
- t.rollback();
-
- // openjpa-facade test
- assertTrue(em instanceof OpenJPAEntityManager);
- OpenJPAEntityManager ojem = (OpenJPAEntityManager) em;
- ojem.getFetchPlan().setMaxFetchDepth(1);
- assertEquals(1, ojem.getFetchPlan().getMaxFetchDepth());
- em.close();
- }
-
- public void testPersist() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.persist(new AllFieldTypes());
- em.getTransaction().commit();
- em.close();
- }
-
- public void testQuery() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- AllFieldTypes aft = new AllFieldTypes();
- aft.setStringField("foo");
- aft.setIntField(10);
- em.persist(aft);
- em.getTransaction().commit();
- em.close();
-
- em = emf.createEntityManager();
- em.getTransaction().begin();
- assertEquals(1, em.createQuery
- ("select x from AllFieldTypes x where x.stringField = 'foo'").
- getResultList().size());
- assertEquals(0, em.createQuery
- ("select x from AllFieldTypes x where x.stringField = 'bar'").
- getResultList().size());
- assertEquals(1, em.createQuery
- ("select x from AllFieldTypes x where x.intField >= 10").
- getResultList().size());
- em.getTransaction().rollback();
- em.close();
- }
-
- public static void main(String[] args) {
- TestRunner.run(TestPersistence.class);
- }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.simple;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+
+import junit.textui.TestRunner;
+import org.apache.openjpa.persistence.OpenJPAEntityManager;
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+
+/**
+ * Simple test case to get an EntityManager and perform some basic operations.
+ *
+ * @author Marc Prud'hommeaux
+ */
+public class TestPersistence
+ extends SingleEMFTestCase {
+
+ public void setUp() {
+ setUp(AllFieldTypes.class);
+ }
+
+ public void testCreateEntityManager() {
+ EntityManager em = emf.createEntityManager();
+
+ EntityTransaction t = em.getTransaction();
+ assertNotNull(t);
+ t.begin();
+ t.setRollbackOnly();
+ t.rollback();
+
+ // openjpa-facade test
+ assertTrue(em instanceof OpenJPAEntityManager);
+ OpenJPAEntityManager ojem = (OpenJPAEntityManager) em;
+ ojem.getFetchPlan().setMaxFetchDepth(1);
+ assertEquals(1, ojem.getFetchPlan().getMaxFetchDepth());
+ em.close();
+ }
+
+ public void testPersist() {
+ EntityManager em = emf.createEntityManager();
+ em.getTransaction().begin();
+ em.persist(new AllFieldTypes());
+ em.getTransaction().commit();
+ em.close();
+ }
+
+ public void testQuery() {
+ EntityManager em = emf.createEntityManager();
+ em.getTransaction().begin();
+ AllFieldTypes aft = new AllFieldTypes();
+ aft.setStringField("foo");
+ aft.setIntField(10);
+ em.persist(aft);
+ em.getTransaction().commit();
+ em.close();
+
+ em = emf.createEntityManager();
+ em.getTransaction().begin();
+ assertEquals(1, em.createQuery
+ ("select x from AllFieldTypes x where x.stringField = 'foo'").
+ getResultList().size());
+ assertEquals(0, em.createQuery
+ ("select x from AllFieldTypes x where x.stringField = 'bar'").
+ getResultList().size());
+ assertEquals(1, em.createQuery
+ ("select x from AllFieldTypes x where x.intField >= 10").
+ getResultList().size());
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+ public static void main(String[] args) {
+ TestRunner.run(TestPersistence.class);
+ }
+}
+
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/entities/Customer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/entities/EAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/entities/Order.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/CANAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/GBRAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/ShortAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/xmlbindings/myaddress/USAAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AutoClearType.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AutoClearType.java?rev=757280&r1=757279&r2=757280&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AutoClearType.java (original)
+++ openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AutoClearType.java Sun Mar 22 23:45:15 2009
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openjpa.persistence;
-
-import org.apache.openjpa.kernel.AutoClear;
-
-/**
- * The possible settings for the auto-clear behavior of an
- * {@link OpenJPAEntityManager}.
- *
- * @since 1.0.0
- * @published
- */
-public enum AutoClearType {
- DATASTORE(AutoClear.CLEAR_DATASTORE),
- ALL(AutoClear.CLEAR_ALL);
-
- private final int autoClearConstant;
-
- private AutoClearType(int value) {
- autoClearConstant = value;
- }
-
- int toKernelConstant() {
- return autoClearConstant;
- }
-
- static AutoClearType fromKernelConstant(int kernelConstant) {
- switch (kernelConstant) {
- case AutoClear.CLEAR_DATASTORE:
- return DATASTORE;
-
- case AutoClear.CLEAR_ALL:
- return ALL;
-
- default:
- throw new IllegalArgumentException(kernelConstant + "");
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence;
+
+import org.apache.openjpa.kernel.AutoClear;
+
+/**
+ * The possible settings for the auto-clear behavior of an
+ * {@link OpenJPAEntityManager}.
+ *
+ * @since 1.0.0
+ * @published
+ */
+public enum AutoClearType {
+ DATASTORE(AutoClear.CLEAR_DATASTORE),
+ ALL(AutoClear.CLEAR_ALL);
+
+ private final int autoClearConstant;
+
+ private AutoClearType(int value) {
+ autoClearConstant = value;
+ }
+
+ int toKernelConstant() {
+ return autoClearConstant;
+ }
+
+ static AutoClearType fromKernelConstant(int kernelConstant) {
+ switch (kernelConstant) {
+ case AutoClear.CLEAR_DATASTORE:
+ return DATASTORE;
+
+ case AutoClear.CLEAR_ALL:
+ return ALL;
+
+ default:
+ throw new IllegalArgumentException(kernelConstant + "");
+ }
+ }
+}
Propchange: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AutoClearType.java
------------------------------------------------------------------------------
svn:eol-style = native