Author: dgeraskov
Date: 2011-11-01 05:45:38 -0400 (Tue, 01 Nov 2011)
New Revision: 36107
Removed:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Clinic.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/META-INF/orm.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/BaseSuperclass.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Owner.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Pet.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/TestIdClass.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Vet.java
Log:
https://issues.jboss.org/browse/JBIDE-10073
Fix compile errors in test mapping
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/META-INF/orm.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/META-INF/orm.xml 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/META-INF/orm.xml 2011-11-01
09:45:38 UTC (rev 36107)
@@ -15,15 +15,15 @@
<mapped-superclass class="BaseSuperclass" access="FIELD">
<attributes>
- <embedded-id name="embeddedId">
+ <embedded-id name="embeddedId" >
</embedded-id>
<!-- id name="simpleId">
<generated-value strategy="IDENTITY"/>
</id-->
</attributes>
</mapped-superclass>
-
- <mapped-superclass class="BaseEntity">
+
+ <mapped-superclass class="BaseEntity" access="FIELD">
<attributes>
<id name="id">
<generated-value strategy="IDENTITY"/>
@@ -50,17 +50,7 @@
</basic>
</attributes>
</mapped-superclass>
-
- <entity class="TestIdClass" access="FIELD">
- <attributes>
- <!-- id name="id">
- <generated-value strategy="IDENTITY"/>
- </id-->
- <embedded-id name="id">
- </embedded-id>
- </attributes>
- </entity>
-
+
<entity class="SuperOffspring" access="FIELD">
<table name="SUPEROFFSPRING"/>
<attributes>
@@ -69,7 +59,7 @@
</basic>
</attributes>
</entity>
-
+
<entity class="Vet">
<table name="VETS"/>
<attributes>
@@ -147,5 +137,12 @@
</many-to-one>
</attributes>
</entity>
+
+
+ <embeddable class="TestIdClass" access="FIELD">
+ <attributes>
+ <basic name="id"/>
+ </attributes>
+ </embeddable>
</entity-mappings>
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/BaseSuperclass.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/BaseSuperclass.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/BaseSuperclass.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -8,15 +8,15 @@
public class BaseSuperclass {
@EmbeddedId
- protected Object embeddedId;
+ protected TestIdClass embeddedId;
//@Id
//protected Integer simpleId;
- public Object getTestId() {
+ public Object getEmbeddedId() {
return embeddedId;
}
- public void setTestId(Object embeddedId) {
+ public void setEmbeddedId(TestIdClass embeddedId) {
this.embeddedId = embeddedId;
}
Deleted:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Clinic.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Clinic.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Clinic.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -1,82 +0,0 @@
-package jpa.springframework.samples.petclinic;
-
-import java.util.Collection;
-
-import org.springframework.dao.DataAccessException;
-
-/**
- * The high-level PetClinic business interface.
- *
- * <p>This is basically a data access object.
- * PetClinic doesn't have a dedicated business facade.
- *
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- */
-public interface Clinic {
-
- /**
- * Retrieve all <code>Vet</code>s from the data store.
- * @return a <code>Collection</code> of <code>Vet</code>s
- */
- Collection<Vet> getVets() throws DataAccessException;
-
- /**
- * Retrieve all <code>PetType</code>s from the data store.
- * @return a <code>Collection</code> of <code>PetType</code>s
- */
- Collection<PetType> getPetTypes() throws DataAccessException;
-
- /**
- * Retrieve <code>Owner</code>s from the data store by last name,
- * returning all owners whose last name <i>starts</i> with the given name.
- * @param lastName Value to search for
- * @return a <code>Collection</code> of matching
<code>Owner</code>s
- * (or an empty <code>Collection</code> if none found)
- */
- Collection<Owner> findOwners(String lastName) throws DataAccessException;
-
- /**
- * Retrieve an <code>Owner</code> from the data store by id.
- * @param id the id to search for
- * @return the <code>Owner</code> if found
- * @throws org.springframework.dao.DataRetrievalFailureException if not found
- */
- Owner loadOwner(int id) throws DataAccessException;
-
- /**
- * Retrieve a <code>Pet</code> from the data store by id.
- * @param id the id to search for
- * @return the <code>Pet</code> if found
- * @throws org.springframework.dao.DataRetrievalFailureException if not found
- */
- Pet loadPet(int id) throws DataAccessException;
-
- /**
- * Save an <code>Owner</code> to the data store, either inserting or
updating it.
- * @param owner the <code>Owner</code> to save
- * @see BaseEntity#isNew
- */
- void storeOwner(Owner owner) throws DataAccessException;
-
- /**
- * Save a <code>Pet</code> to the data store, either inserting or updating
it.
- * @param pet the <code>Pet</code> to save
- * @see BaseEntity#isNew
- */
- void storePet(Pet pet) throws DataAccessException;
-
- /**
- * Save a <code>Visit</code> to the data store, either inserting or updating
it.
- * @param visit the <code>Visit</code> to save
- * @see BaseEntity#isNew
- */
- void storeVisit(Visit visit) throws DataAccessException;
-
- /**
- * Deletes a <code>Pet</code> from the data store.
- */
- void deletePet(int id) throws DataAccessException;
-
-}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Owner.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Owner.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Owner.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -5,11 +5,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
-import org.springframework.beans.support.MutableSortDefinition;
-import org.springframework.beans.support.PropertyComparator;
-import org.springframework.core.style.ToStringCreator;
-
/**
* Simple JavaBean domain object representing an owner.
*
@@ -65,7 +60,7 @@
public List<Pet> getPets() {
List<Pet> sortedPets = new ArrayList<Pet>(getPetsInternal());
- PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true,
true));
+ //PropertyComparator.sort(sortedPets, new MutableSortDefinition("name", true,
true));
return Collections.unmodifiableList(sortedPets);
}
@@ -104,24 +99,5 @@
return null;
}
- @Override
- public String toString() {
- return new ToStringCreator(this)
-
- .append("id", this.getId())
-
- .append("new", this.isNew())
-
- .append("lastName", this.getLastName())
-
- .append("firstName", this.getFirstName())
-
- .append("address", this.address)
-
- .append("city", this.city)
-
- .append("telephone", this.telephone)
-
- .toString();
- }
+
}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Pet.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Pet.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Pet.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -7,8 +7,6 @@
import java.util.List;
import java.util.Set;
-import org.springframework.beans.support.MutableSortDefinition;
-import org.springframework.beans.support.PropertyComparator;
/**
* Simple JavaBean business object representing a pet.
@@ -75,7 +73,7 @@
public List<Visit> getVisits() {
List<Visit> sortedVisits = new ArrayList<Visit>(getVisitsInternal());
- PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date",
false, false));
+ //PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date",
false, false));
return Collections.unmodifiableList(sortedVisits);
}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/TestIdClass.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/TestIdClass.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/TestIdClass.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -1,24 +1,18 @@
package jpa.springframework.samples.petclinic;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Id;
+import javax.persistence.*;
-@Entity
+@Embeddable
public class TestIdClass {
- //@Id
- //protected Integer id;
- @EmbeddedId
- protected Object id;
+ @Column
+ protected Integer id;
- //public Integer getId() {
- public Object getId() {
- return id;
+ public Integer getId() {
+ return this.id;
}
- //public void setId(Integer id) {
- public void setId(Object id) {
+ public void setId(Integer id) {
this.id = id;
}
}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Vet.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Vet.java 2011-11-01
02:23:36 UTC (rev 36106)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/jpa/springframework/samples/petclinic/Vet.java 2011-11-01
09:45:38 UTC (rev 36107)
@@ -7,9 +7,6 @@
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
-import org.springframework.beans.support.MutableSortDefinition;
-import org.springframework.beans.support.PropertyComparator;
-
/**
* Simple JavaBean domain object representing a veterinarian.
*
@@ -37,7 +34,7 @@
@XmlElement
public List<Specialty> getSpecialties() {
List<Specialty> sortedSpecs = new
ArrayList<Specialty>(getSpecialtiesInternal());
- PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name", true,
true));
+ //PropertyComparator.sort(sortedSpecs, new MutableSortDefinition("name",
true, true));
return Collections.unmodifiableList(sortedSpecs);
}