mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-29 14:29:37 +00:00
removing xml OR mapping so we only use annotations
This commit is contained in:
parent
3482d549ea
commit
e93f0f60a6
2 changed files with 1 additions and 132 deletions
|
@ -3,14 +3,5 @@
|
|||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
|
||||
version="1.0">
|
||||
|
||||
<persistence-unit name="PetClinic" transaction-type="RESOURCE_LOCAL">
|
||||
|
||||
<!-- Explicitly define mapping file path, else Hibernate won't find the default -->
|
||||
<mapping-file>META-INF/orm.xml</mapping-file>
|
||||
|
||||
<!-- Prevent annotation scanning. In this app we are purely driven by orm.xml -->
|
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
||||
|
||||
</persistence-unit>
|
||||
|
||||
<persistence-unit name="PetClinic" transaction-type="RESOURCE_LOCAL"/>
|
||||
</persistence>
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
|
||||
version="1.0">
|
||||
|
||||
<persistence-unit-metadata>
|
||||
<xml-mapping-metadata-complete/>
|
||||
<persistence-unit-defaults>
|
||||
<access>PROPERTY</access>
|
||||
</persistence-unit-defaults>
|
||||
</persistence-unit-metadata>
|
||||
|
||||
<package>org.springframework.samples.petclinic</package>
|
||||
|
||||
<mapped-superclass class="BaseEntity">
|
||||
<attributes>
|
||||
<id name="id">
|
||||
<generated-value strategy="IDENTITY"/>
|
||||
</id>
|
||||
<transient name="new"/>
|
||||
</attributes>
|
||||
</mapped-superclass>
|
||||
|
||||
<mapped-superclass class="NamedEntity">
|
||||
<attributes>
|
||||
<basic name="name">
|
||||
<column name="NAME"/>
|
||||
</basic>
|
||||
</attributes>
|
||||
</mapped-superclass>
|
||||
|
||||
<mapped-superclass class="Person">
|
||||
<attributes>
|
||||
<basic name="firstName">
|
||||
<column name="FIRST_NAME"/>
|
||||
</basic>
|
||||
<basic name="lastName">
|
||||
<column name="LAST_NAME"/>
|
||||
</basic>
|
||||
</attributes>
|
||||
</mapped-superclass>
|
||||
|
||||
<entity class="Vet">
|
||||
<table name="vets"/>
|
||||
<attributes>
|
||||
<many-to-many name="specialtiesInternal" target-entity="Specialty" fetch="EAGER">
|
||||
<join-table name="vet_specialties">
|
||||
<join-column name="VET_ID"/>
|
||||
<inverse-join-column name="SPECIALTY_ID"/>
|
||||
</join-table>
|
||||
</many-to-many>
|
||||
<transient name="specialties"/>
|
||||
<transient name="nrOfSpecialties"/>
|
||||
</attributes>
|
||||
</entity>
|
||||
|
||||
<entity class="Specialty">
|
||||
<table name="specialties"/>
|
||||
</entity>
|
||||
|
||||
<entity class="Owner">
|
||||
<table name="owners"/>
|
||||
<attributes>
|
||||
<basic name="address"/>
|
||||
<basic name="city"/>
|
||||
<basic name="telephone"/>
|
||||
<one-to-many name="petsInternal" target-entity="Pet" mapped-by="owner" fetch="EAGER">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
<transient name="pets"/>
|
||||
</attributes>
|
||||
</entity>
|
||||
|
||||
<entity class="Pet">
|
||||
<table name="pets"/>
|
||||
<attributes>
|
||||
<basic name="birthDate">
|
||||
<column name="BIRTH_DATE"/>
|
||||
<temporal>DATE</temporal>
|
||||
</basic>
|
||||
<many-to-one name="owner" fetch="EAGER">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</many-to-one>
|
||||
<many-to-one name="type" fetch="EAGER">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</many-to-one>
|
||||
<one-to-many name="visitsInternal" target-entity="Visit" mapped-by="pet" fetch="EAGER">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
<transient name="visits"/>
|
||||
</attributes>
|
||||
</entity>
|
||||
|
||||
<entity class="PetType">
|
||||
<table name="types"/>
|
||||
</entity>
|
||||
|
||||
<entity class="Visit">
|
||||
<table name="visits"/>
|
||||
<attributes>
|
||||
<basic name="date">
|
||||
<column name="VISIT_DATE"/>
|
||||
<temporal>DATE</temporal>
|
||||
</basic>
|
||||
<many-to-one name="pet" fetch="EAGER">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</many-to-one>
|
||||
</attributes>
|
||||
</entity>
|
||||
|
||||
</entity-mappings>
|
Loading…
Reference in a new issue