HHH-4942 Rectified some problem with earlier commit. Some files got deleted which should not have been. And some files were wrongly added

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18865 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Hardy Ferentschik 2010-02-23 23:55:06 +00:00
parent d44d367134
commit 003658834d
6 changed files with 79 additions and 1598 deletions

View File

@ -0,0 +1,36 @@
<?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 orm_1_0.xsd"
version="1.0"
>
<persistence-unit-metadata>
<persistence-unit-defaults>
<entity-listeners>
<entity-listener class="org.hibernate.ejb.test.pack.defaultpar.IncrementListener">
<pre-persist method-name="increment"/>
</entity-listener>
</entity-listeners>
</persistence-unit-defaults>
</persistence-unit-metadata>
<package>org.hibernate.ejb.test.pack.defaultpar</package>
<entity class="Lighter" access="FIELD" metadata-complete="true">
<attributes>
<id name="name">
<column name="fld_id"/>
</id>
<basic name="power"></basic>
</attributes>
</entity>
<entity class="ApplicationServer">
<entity-listeners>
<entity-listener class="OtherIncrementListener">
<pre-persist method-name="increment"/>
</entity-listener>
</entity-listeners>
</entity>
</entity-mappings>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- example of a default persistence.xml -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="defaultpar">
<class>org.hibernate.ejb.test.pack.defaultpar.Lighter</class>
<properties>
<property name="hibernate.dialect" value="${db.dialect}"/>
<property name="hibernate.connection.driver_class" value="${jdbc.driver}"/>
<property name="hibernate.connection.username" value="${jdbc.user}"/>
<property name="hibernate.connection.password" value="${jdbc.pass}"/>
<property name="hibernate.connection.url" value="${jdbc.url}"/>
<property name="hibernate.connection.isolation" value="${jdbc.isolation}"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
</properties>
</persistence-unit>
</persistence>

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
package="org.hibernate.ejb.test.pack.war"
>
<class name="Mouse">
<id name="id">
<generator class="native"/>
</id>
<property name="name"/>
</class>
</hibernate-mapping>

View File

@ -1,104 +0,0 @@
// $Id:$
/*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed 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.hibernate.ejb.test.metadata;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
* @author Hardy Ferentschik
*/
@Embeddable
public class PrcontraPK implements Serializable {
private static final long serialVersionUID = 7441961985141369232L;
@Column(name = "NUMERO", nullable = false)
private BigInteger numero;
@Column(name = "RENOV", nullable = false)
private BigInteger renov;
@Column(name = "TIPO", nullable = false)
private BigInteger tipo;
public PrcontraPK() {
}
public PrcontraPK(BigInteger numero, BigInteger renov, BigInteger tipo) {
this.numero = numero;
this.renov = renov;
this.tipo = tipo;
}
public BigInteger getNumero() {
return numero;
}
public void setNumero(BigInteger numero) {
this.numero = numero;
}
public BigInteger getRenov() {
return renov;
}
public void setRenov(BigInteger renov) {
this.renov = renov;
}
public BigInteger getTipo() {
return tipo;
}
public void setTipo(BigInteger tipo) {
this.tipo = tipo;
}
@Override
public int hashCode() {
int hash = 0;
hash += ( numero != null ? numero.hashCode() : 0 );
hash += ( renov != null ? renov.hashCode() : 0 );
hash += ( tipo != null ? tipo.hashCode() : 0 );
return hash;
}
@Override
public boolean equals(Object object) {
if ( !( object instanceof PrcontraPK ) ) {
return false;
}
PrcontraPK other = ( PrcontraPK ) object;
if ( this.numero != other.numero && ( this.numero == null || !this.numero.equals( other.numero ) ) ) {
return false;
}
if ( this.renov != other.renov && ( this.renov == null || !this.renov.equals( other.renov ) ) ) {
return false;
}
if ( this.tipo != other.tipo && ( this.tipo == null || !this.tipo.equals( other.tipo ) ) ) {
return false;
}
return true;
}
@Override
public String toString() {
return "org.kyrian.entity.muvale.PrcontraPK[numero=" + numero + ", renov=" + renov + ", tipo=" + tipo + "]";
}
}

View File

@ -37,10 +37,6 @@ import org.hibernate.ejb.test.TestCase;
*/ */
public class StaticMetadataTest extends TestCase { public class StaticMetadataTest extends TestCase {
public void testEmbeddedId() throws Exception {
assertNotNull( Prcontra_.prcontraPK );
}
public void testInjections() throws Exception { public void testInjections() throws Exception {
// Address (embeddable) // Address (embeddable)
assertNotNull( Address_.address1 ); assertNotNull( Address_.address1 );
@ -140,9 +136,7 @@ public class StaticMetadataTest extends TestCase {
Cattish.class, Cattish.class,
Feline.class, Feline.class,
Garden.class, Garden.class,
Flower.class, Flower.class
Prcontra.class,
PrcontraPK.class
}; };
} }
} }