Author: adamw
Date: 2008-10-21 09:16:25 -0400 (Tue, 21 Oct 2008)
New Revision: 180
Added:
trunk/src/test/org/jboss/envers/test/various/Address.java
trunk/src/test/org/jboss/envers/test/various/Person.java
Modified:
trunk/src/test/org/jboss/envers/test/various/HsqlTest.java
Log:
Test update
Copied: trunk/src/test/org/jboss/envers/test/various/Address.java (from rev 173,
trunk/src/demo/org/jboss/envers/demo/Address.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/various/Address.java (rev
0)
+++ trunk/src/test/org/jboss/envers/test/various/Address.java 2008-10-21 13:16:25 UTC (rev
180)
@@ -0,0 +1,113 @@
+/*
+ * Envers.
http://www.jboss.org/envers
+ *
+ * Copyright 2008 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Adam Warski
+ */
+package org.jboss.envers.test.various;
+
+import org.jboss.envers.Versioned;
+
+import javax.persistence.*;
+import java.util.Set;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class Address {
+ @Id
+ @GeneratedValue
+ private int id;
+
+ @Versioned
+ private String streetName;
+
+ @Versioned
+ private Integer houseNumber;
+
+ @Versioned
+ private Integer flatNumber;
+
+ @Versioned
+ @OneToMany(mappedBy = "address")
+ private Set<Person> persons;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getStreetName() {
+ return streetName;
+ }
+
+ public void setStreetName(String streetName) {
+ this.streetName = streetName;
+ }
+
+ public Integer getHouseNumber() {
+ return houseNumber;
+ }
+
+ public void setHouseNumber(Integer houseNumber) {
+ this.houseNumber = houseNumber;
+ }
+
+ public Integer getFlatNumber() {
+ return flatNumber;
+ }
+
+ public void setFlatNumber(Integer flatNumber) {
+ this.flatNumber = flatNumber;
+ }
+
+ public Set<Person> getPersons() {
+ return persons;
+ }
+
+ public void setPersons(Set<Person> persons) {
+ this.persons = persons;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof Address)) return false;
+
+ Address address = (Address) o;
+
+ if (id != address.id) return false;
+ if (flatNumber != null ? !flatNumber.equals(address.flatNumber) :
address.flatNumber != null) return false;
+ if (houseNumber != null ? !houseNumber.equals(address.houseNumber) :
address.houseNumber != null) return false;
+ if (streetName != null ? !streetName.equals(address.streetName) :
address.streetName != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = id;
+ result = 31 * result + (streetName != null ? streetName.hashCode() : 0);
+ result = 31 * result + (houseNumber != null ? houseNumber.hashCode() : 0);
+ result = 31 * result + (flatNumber != null ? flatNumber.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/various/Address.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/src/test/org/jboss/envers/test/various/HsqlTest.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/various/HsqlTest.java 2008-10-21 13:00:23 UTC
(rev 179)
+++ trunk/src/test/org/jboss/envers/test/various/HsqlTest.java 2008-10-21 13:16:25 UTC
(rev 180)
@@ -1,7 +1,5 @@
package org.jboss.envers.test.various;
-import org.jboss.envers.demo.Person;
-import org.jboss.envers.demo.Address;
import org.hibernate.Session;
import javax.persistence.EntityManagerFactory;
Copied: trunk/src/test/org/jboss/envers/test/various/Person.java (from rev 173,
trunk/src/demo/org/jboss/envers/demo/Person.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/various/Person.java (rev
0)
+++ trunk/src/test/org/jboss/envers/test/various/Person.java 2008-10-21 13:16:25 UTC (rev
180)
@@ -0,0 +1,99 @@
+/*
+ * Envers.
http://www.jboss.org/envers
+ *
+ * Copyright 2008 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Adam Warski
+ */
+package org.jboss.envers.test.various;
+
+import org.jboss.envers.Versioned;
+
+import javax.persistence.*;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class Person {
+ @Id
+ @GeneratedValue
+ private int id;
+
+ @Versioned
+ private String name;
+
+ @Versioned
+ private String surname;
+
+ @Versioned
+ @ManyToOne
+ private Address address;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof Person)) return false;
+
+ Person person = (Person) o;
+
+ if (id != person.id) return false;
+ if (name != null ? !name.equals(person.name) : person.name != null) return
false;
+ if (surname != null ? !surname.equals(person.surname) : person.surname != null)
return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = id;
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (surname != null ? surname.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/various/Person.java
___________________________________________________________________
Name: svn:mergeinfo
+