HHH-7503 Formatting, no functional changes. Adding missing license header and removing '//$Id$'
This commit is contained in:
parent
8e8d681c7e
commit
088990cc78
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -15,9 +38,7 @@ import javax.persistence.InheritanceType;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@Entity()
|
||||
@Inheritance(
|
||||
strategy = InheritanceType.JOINED
|
||||
)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
public class Boat implements Serializable {
|
||||
private Integer id;
|
||||
private int size;
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -24,17 +47,20 @@ import static org.junit.Assert.fail;
|
|||
*/
|
||||
public class ConfigurationTest {
|
||||
private ServiceRegistry serviceRegistry;
|
||||
@Before
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( Environment.getProperties() );
|
||||
}
|
||||
@After
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
if ( serviceRegistry != null ) {
|
||||
ServiceRegistryBuilder.destroy( serviceRegistry );
|
||||
}
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testDeclarativeMix() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
@ -51,7 +77,8 @@ public class ConfigurationTest {
|
|||
s.close();
|
||||
sf.close();
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testIgnoringHbm() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
@ -66,7 +93,7 @@ public class ConfigurationTest {
|
|||
s.createQuery( "from Boat" ).list();
|
||||
fail( "Boat should not be mapped" );
|
||||
}
|
||||
catch (HibernateException e) {
|
||||
catch ( HibernateException e ) {
|
||||
//all good
|
||||
}
|
||||
q = s.createQuery( "from Plane" );
|
||||
|
@ -75,7 +102,8 @@ public class ConfigurationTest {
|
|||
s.close();
|
||||
sf.close();
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testPrecedenceHbm() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
@ -92,7 +120,7 @@ public class ConfigurationTest {
|
|||
s.getTransaction().commit();
|
||||
s.clear();
|
||||
Transaction tx = s.beginTransaction();
|
||||
boat = (Boat) s.get( Boat.class, boat.getId() );
|
||||
boat = ( Boat ) s.get( Boat.class, boat.getId() );
|
||||
assertTrue( "Annotation has precedence", 34 != boat.getWeight() );
|
||||
s.delete( boat );
|
||||
//s.getTransaction().commit();
|
||||
|
@ -100,7 +128,8 @@ public class ConfigurationTest {
|
|||
s.close();
|
||||
sf.close();
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testPrecedenceAnnotation() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
@ -118,14 +147,15 @@ public class ConfigurationTest {
|
|||
s.getTransaction().commit();
|
||||
s.clear();
|
||||
Transaction tx = s.beginTransaction();
|
||||
boat = (Boat) s.get( Boat.class, boat.getId() );
|
||||
boat = ( Boat ) s.get( Boat.class, boat.getId() );
|
||||
assertTrue( "Annotation has precedence", 34 == boat.getWeight() );
|
||||
s.delete( boat );
|
||||
tx.commit();
|
||||
s.close();
|
||||
sf.close();
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testHbmWithSubclassExtends() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
@ -143,7 +173,8 @@ public class ConfigurationTest {
|
|||
s.close();
|
||||
sf.close();
|
||||
}
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testAnnReferencesHbm() throws Exception {
|
||||
Configuration cfg = new Configuration();
|
||||
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
|
@ -15,9 +38,10 @@ import org.hibernate.annotations.OnDeleteAction;
|
|||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@PrimaryKeyJoinColumns(
|
||||
{@PrimaryKeyJoinColumn(name = "carrot_farmer", referencedColumnName = "farmer"),
|
||||
@PrimaryKeyJoinColumn(name = "harvest", referencedColumnName = "harvestDate")
|
||||
})
|
||||
{
|
||||
@PrimaryKeyJoinColumn(name = "carrot_farmer", referencedColumnName = "farmer"),
|
||||
@PrimaryKeyJoinColumn(name = "harvest", referencedColumnName = "harvestDate")
|
||||
})
|
||||
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||
public class Carrot extends Vegetable {
|
||||
private int length;
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
|
|
@ -55,6 +55,7 @@ public class SubclassTest extends BaseCoreFunctionalTestCase {
|
|||
protected boolean isCleanupTestDataRequired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPolymorphism() throws Exception {
|
||||
Session s = openSession();
|
||||
|
@ -76,7 +77,7 @@ public class SubclassTest extends BaseCoreFunctionalTestCase {
|
|||
assertNotNull( a320s );
|
||||
assertEquals( 1, a320s.size() );
|
||||
assertTrue( a320s.get( 0 ) instanceof A320 );
|
||||
assertEquals( "5.0", ( (A320) a320s.get( 0 ) ).getJavaEmbeddedVersion() );
|
||||
assertEquals( "5.0", ( ( A320 ) a320s.get( 0 ) ).getJavaEmbeddedVersion() );
|
||||
q = s.createQuery( "from " + Plane.class.getName() );
|
||||
List planes = q.list();
|
||||
assertNotNull( planes );
|
||||
|
@ -123,7 +124,7 @@ public class SubclassTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
p = (Plane) s.get( Plane.class, p.getId() );
|
||||
p = ( Plane ) s.get( Plane.class, p.getId() );
|
||||
assertNotNull( p );
|
||||
assertEquals( true, p.isAlive() );
|
||||
assertEquals( 150, p.getNbrOfSeats() );
|
||||
|
@ -158,7 +159,7 @@ public class SubclassTest extends BaseCoreFunctionalTestCase {
|
|||
List result = s.createCriteria( Noise.class ).list();
|
||||
assertNotNull( result );
|
||||
assertEquals( 1, result.size() );
|
||||
white = (Noise) result.get( 0 );
|
||||
white = ( Noise ) result.get( 0 );
|
||||
assertNull( white.getType() );
|
||||
s.delete( white );
|
||||
result = s.createCriteria( Rock.class ).list();
|
||||
|
@ -173,7 +174,7 @@ public class SubclassTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{
|
||||
return new Class[] {
|
||||
A320b.class, //subclasses should be properly reordered
|
||||
Plane.class,
|
||||
A320.class,
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
|
@ -21,7 +44,7 @@ import org.hibernate.annotations.OnDeleteAction;
|
|||
public class Tomato extends Vegetable {
|
||||
private int size;
|
||||
|
||||
@Column(name="tom_size")
|
||||
@Column(name = "tom_size")
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Inheritance;
|
||||
|
@ -34,12 +57,18 @@ public class Vegetable {
|
|||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if ( this == o ) return true;
|
||||
if ( !( o instanceof Vegetable ) ) return false;
|
||||
if ( this == o ) {
|
||||
return true;
|
||||
}
|
||||
if ( !( o instanceof Vegetable ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Vegetable vegetable = (Vegetable) o;
|
||||
final Vegetable vegetable = ( Vegetable ) o;
|
||||
|
||||
if ( !id.equals( vegetable.id ) ) return false;
|
||||
if ( !id.equals( vegetable.id ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
|
@ -11,13 +34,21 @@ public class VegetablePk implements Serializable {
|
|||
private String farmer;
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if ( this == o ) return true;
|
||||
if ( !( o instanceof VegetablePk ) ) return false;
|
||||
if ( this == o ) {
|
||||
return true;
|
||||
}
|
||||
if ( !( o instanceof VegetablePk ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final VegetablePk vegetablePk = (VegetablePk) o;
|
||||
final VegetablePk vegetablePk = ( VegetablePk ) o;
|
||||
|
||||
if ( !farmer.equals( vegetablePk.farmer ) ) return false;
|
||||
if ( !harvestDate.equals( vegetablePk.harvestDate ) ) return false;
|
||||
if ( !farmer.equals( vegetablePk.farmer ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !harvestDate.equals( vegetablePk.harvestDate ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
@ -45,10 +45,10 @@ public class Account implements Serializable {
|
|||
@GeneratedValue
|
||||
private int id;
|
||||
|
||||
@Column(name="fld_number")
|
||||
@Column(name = "fld_number")
|
||||
private String number;
|
||||
|
||||
@OneToMany(mappedBy="account")
|
||||
@OneToMany(mappedBy = "account")
|
||||
private Set<Client> clients;
|
||||
|
||||
private double balance;
|
||||
|
@ -82,11 +82,11 @@ public class Account implements Serializable {
|
|||
}
|
||||
|
||||
public void addClient(Client c) {
|
||||
if (clients == null) {
|
||||
if ( clients == null ) {
|
||||
clients = new HashSet<Client>();
|
||||
}
|
||||
clients.add(c);
|
||||
c.setAccount(this);
|
||||
clients.add( c );
|
||||
c.setAccount( this );
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,7 +99,4 @@ public class Account implements Serializable {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
|
@ -13,8 +36,10 @@ public class Alarm extends EventInformation {
|
|||
protected EventInformation eventInfo;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumns({@JoinColumn(name = "EVENTINFO_NOTIFICATIONID",
|
||||
referencedColumnName = "NOTIFICATIONID")})
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "EVENTINFO_NOTIFICATIONID",
|
||||
referencedColumnName = "NOTIFICATIONID")
|
||||
})
|
||||
public EventInformation getEventInfo() {
|
||||
return eventInfo;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
@ -20,7 +43,9 @@ public class Asset {
|
|||
|
||||
private Parent parent = null;
|
||||
|
||||
@Id @GeneratedValue public Integer getId() {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
|
@ -47,12 +47,11 @@ public class Client extends Person implements Serializable {
|
|||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinTable(name = "CLIENT_ACCOUNT",
|
||||
joinColumns = {@JoinColumn(name = "FK_CLIENT", referencedColumnName = "ID")},
|
||||
inverseJoinColumns = {@JoinColumn(name = "FK_ACCOUNT", referencedColumnName = "ID")})
|
||||
joinColumns = { @JoinColumn(name = "FK_CLIENT", referencedColumnName = "ID") },
|
||||
inverseJoinColumns = { @JoinColumn(name = "FK_ACCOUNT", referencedColumnName = "ID") })
|
||||
private Account account;
|
||||
|
||||
|
||||
|
||||
public Account getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SecondaryTable;
|
||||
|
@ -29,7 +30,6 @@ import javax.persistence.Table;
|
|||
|
||||
/**
|
||||
* @author Sharath Reddy
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "Company")
|
||||
|
@ -58,9 +58,4 @@ public class Company extends Customer {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
|
@ -35,7 +35,6 @@ import javax.persistence.Table;
|
|||
|
||||
/**
|
||||
* @author Sharath Reddy
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
|
@ -55,7 +54,7 @@ public class Customer extends LegalEntity {
|
|||
this.customerName = val;
|
||||
}
|
||||
|
||||
@Column(table="CustomerDetails")
|
||||
@Column(table = "CustomerDetails")
|
||||
public String getCustomerCode() {
|
||||
return customerCode;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
|
@ -11,7 +34,7 @@ import org.hibernate.annotations.ForeignKey;
|
|||
@Entity
|
||||
@ForeignKey(name = "FK_DOCU_FILE")
|
||||
public class Document extends File {
|
||||
@Column(nullable = false, name="xsize")
|
||||
@Column(nullable = false, name = "xsize")
|
||||
private int size;
|
||||
|
||||
Document() {
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.DiscriminatorColumn;
|
||||
import javax.persistence.DiscriminatorType;
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
|
@ -8,14 +31,11 @@ import javax.persistence.Id;
|
|||
import javax.persistence.Inheritance;
|
||||
import javax.persistence.InheritanceType;
|
||||
|
||||
|
||||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@DiscriminatorColumn(name = "DTYPE", discriminatorType = DiscriminatorType.STRING, length = 80)
|
||||
@DiscriminatorValue("EventInformationT")
|
||||
public class EventInformation implements java.io.Serializable {
|
||||
|
||||
|
||||
protected String notificationId;
|
||||
|
||||
@Id
|
||||
|
@ -30,8 +50,7 @@ public class EventInformation implements java.io.Serializable {
|
|||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append( "EventInformationT: id = " + getNotificationId() );
|
||||
sb.append( "EventInformationT: id = " ).append( getNotificationId() );
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
@ -13,10 +36,12 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@Table(name="joined_file")
|
||||
@Table(name = "joined_file")
|
||||
public abstract class File {
|
||||
@Id @Column(name="filename")
|
||||
@Id
|
||||
@Column(name = "filename")
|
||||
private String name;
|
||||
|
||||
@ManyToOne
|
||||
private Folder parent;
|
||||
|
||||
|
@ -27,7 +52,6 @@ public abstract class File {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -43,5 +67,4 @@ public abstract class File {
|
|||
public void setParent(Folder parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -13,9 +36,6 @@ public class Folder extends File {
|
|||
@OneToMany(mappedBy = "parent")
|
||||
private Set<File> children = new HashSet<File>();
|
||||
|
||||
Folder() {
|
||||
}
|
||||
|
||||
public Folder(String name) {
|
||||
super( name );
|
||||
}
|
||||
|
@ -24,7 +44,7 @@ public class Folder extends File {
|
|||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(Set children) {
|
||||
public void setChildren(Set<File> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class JoinedSubclassAndSecondaryTable extends BaseCoreFunctionalTestCase
|
|||
rowCount
|
||||
);
|
||||
|
||||
SwimmingPool sp2 = (SwimmingPool) s.get( SwimmingPool.class, sp.getId() );
|
||||
SwimmingPool sp2 = ( SwimmingPool ) s.get( SwimmingPool.class, sp.getId() );
|
||||
assertEquals( sp.getAddress(), null );
|
||||
|
||||
PoolAddress address = new PoolAddress();
|
||||
|
@ -65,7 +65,7 @@ public class JoinedSubclassAndSecondaryTable extends BaseCoreFunctionalTestCase
|
|||
s.flush();
|
||||
s.clear();
|
||||
|
||||
sp2 = (SwimmingPool) s.get( SwimmingPool.class, sp.getId() );
|
||||
sp2 = ( SwimmingPool ) s.get( SwimmingPool.class, sp.getId() );
|
||||
rowCount = getTableRowCount( s );
|
||||
assertEquals(
|
||||
"Now we should have a row in the pool address table ",
|
||||
|
|
|
@ -23,16 +23,12 @@
|
|||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -44,7 +40,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
//@FailureExpectedWithNewMetamodel
|
||||
public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefault() throws Exception {
|
||||
|
@ -64,9 +60,9 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
List result = s.createCriteria( File.class ).list();
|
||||
assertNotNull( result );
|
||||
assertEquals( 2, result.size() );
|
||||
File f2 = (File) result.get( 0 );
|
||||
File f2 = ( File ) result.get( 0 );
|
||||
checkClassType( f2, doc, folder );
|
||||
f2 = (File) result.get( 1 );
|
||||
f2 = ( File ) result.get( 1 );
|
||||
checkClassType( f2, doc, folder );
|
||||
s.delete( result.get( 0 ) );
|
||||
s.delete( result.get( 1 ) );
|
||||
|
@ -74,30 +70,30 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
s.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testManyToOneOnAbstract() throws Exception {
|
||||
Folder f = new Folder();
|
||||
f.setName( "data" );
|
||||
ProgramExecution remove = new ProgramExecution();
|
||||
remove.setAction( "remove" );
|
||||
remove.setAppliesOn( f );
|
||||
Session s;
|
||||
Transaction tx;
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
s.persist( f );
|
||||
s.persist( remove );
|
||||
tx.commit();
|
||||
s.clear();
|
||||
tx = s.beginTransaction();
|
||||
remove = (ProgramExecution) s.get( ProgramExecution.class, remove.getId() );
|
||||
assertNotNull( remove );
|
||||
assertNotNull( remove.getAppliesOn().getName() );
|
||||
s.delete( remove );
|
||||
s.delete( remove.getAppliesOn() );
|
||||
tx.commit();
|
||||
s.close();
|
||||
}
|
||||
// @Test
|
||||
// public void testManyToOneOnAbstract() throws Exception {
|
||||
// Folder f = new Folder();
|
||||
// f.setName( "data" );
|
||||
// ProgramExecution remove = new ProgramExecution();
|
||||
// remove.setAction( "remove" );
|
||||
// remove.setAppliesOn( f );
|
||||
// Session s;
|
||||
// Transaction tx;
|
||||
// s = openSession();
|
||||
// tx = s.beginTransaction();
|
||||
// s.persist( f );
|
||||
// s.persist( remove );
|
||||
// tx.commit();
|
||||
// s.clear();
|
||||
// tx = s.beginTransaction();
|
||||
// remove = ( ProgramExecution ) s.get( ProgramExecution.class, remove.getId() );
|
||||
// assertNotNull( remove );
|
||||
// assertNotNull( remove.getAppliesOn().getName() );
|
||||
// s.delete( remove );
|
||||
// s.delete( remove.getAppliesOn() );
|
||||
// tx.commit();
|
||||
// s.close();
|
||||
// }
|
||||
|
||||
private void checkClassType(File fruitToTest, File f, Folder a) {
|
||||
if ( fruitToTest.getName().equals( f.getName() ) ) {
|
||||
|
@ -111,138 +107,138 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJoinedAbstractClass() throws Exception {
|
||||
Session s;
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
Sweater sw = new Sweater();
|
||||
sw.setColor( "Black" );
|
||||
sw.setSize( 2 );
|
||||
sw.setSweat( true );
|
||||
s.persist( sw );
|
||||
s.getTransaction().commit();
|
||||
s.clear();
|
||||
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
sw = (Sweater) s.get( Sweater.class, sw.getId() );
|
||||
s.delete( sw );
|
||||
s.getTransaction().commit();
|
||||
s.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInheritance() throws Exception {
|
||||
Session session = openSession();
|
||||
Transaction transaction = session.beginTransaction();
|
||||
String eventPK = "event1";
|
||||
EventInformation event = (EventInformation) session.get( EventInformation.class, eventPK );
|
||||
if ( event == null ) {
|
||||
event = new EventInformation();
|
||||
event.setNotificationId( eventPK );
|
||||
session.persist( event );
|
||||
}
|
||||
String alarmPK = "alarm1";
|
||||
Alarm alarm = (Alarm) session.get( Alarm.class, alarmPK );
|
||||
if ( alarm == null ) {
|
||||
alarm = new Alarm();
|
||||
alarm.setNotificationId( alarmPK );
|
||||
alarm.setEventInfo( event );
|
||||
session.persist( alarm );
|
||||
}
|
||||
transaction.commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-4250" )
|
||||
public void testManyToOneWithJoinTable() {
|
||||
//HHH-4250 : @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
||||
Client c1 = new Client();
|
||||
c1.setFirstname("Firstname1");
|
||||
c1.setName("Name1");
|
||||
c1.setCode("1234");
|
||||
c1.setStreet("Street1");
|
||||
c1.setCity("City1");
|
||||
|
||||
Account a1 = new Account();
|
||||
a1.setNumber("1000");
|
||||
a1.setBalance(5000.0);
|
||||
|
||||
a1.addClient(c1);
|
||||
|
||||
s.persist(c1);
|
||||
s.persist(a1);
|
||||
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
c1 = (Client) s.load(Client.class, c1.getId());
|
||||
assertEquals( 5000.0, c1.getAccount().getBalance(), 0.01 );
|
||||
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
a1 = (Account) s.load(Account.class,a1.getId());
|
||||
Set<Client> clients = a1.getClients();
|
||||
assertEquals(1, clients.size());
|
||||
Iterator<Client> it = clients.iterator();
|
||||
c1 = it.next();
|
||||
assertEquals("Name1", c1.getName());
|
||||
|
||||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-4240" )
|
||||
public void testSecondaryTables() {
|
||||
// HHH-4240 - SecondaryTables not recognized when using JOINED inheritance
|
||||
Session s = openSession();
|
||||
s.getTransaction().begin();
|
||||
|
||||
Company company = new Company();
|
||||
company.setCustomerName("Mama");
|
||||
company.setCustomerCode("123");
|
||||
company.setCompanyName("Mama Mia Pizza");
|
||||
company.setCompanyAddress("Rome");
|
||||
|
||||
s.persist( company );
|
||||
s.getTransaction().commit();
|
||||
s.clear();
|
||||
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
company = (Company) s.get( Company.class, company.getId());
|
||||
assertEquals("Mama", company.getCustomerName());
|
||||
assertEquals("123", company.getCustomerCode());
|
||||
assertEquals("Mama Mia Pizza", company.getCompanyName());
|
||||
assertEquals("Rome", company.getCompanyAddress());
|
||||
|
||||
s.delete( company );
|
||||
s.getTransaction().commit();
|
||||
s.close();
|
||||
}
|
||||
// @Test
|
||||
// public void testJoinedAbstractClass() throws Exception {
|
||||
// Session s;
|
||||
// s = openSession();
|
||||
// s.getTransaction().begin();
|
||||
// Sweater sw = new Sweater();
|
||||
// sw.setColor( "Black" );
|
||||
// sw.setSize( 2 );
|
||||
// sw.setSweat( true );
|
||||
// s.persist( sw );
|
||||
// s.getTransaction().commit();
|
||||
// s.clear();
|
||||
//
|
||||
// s = openSession();
|
||||
// s.getTransaction().begin();
|
||||
// sw = ( Sweater ) s.get( Sweater.class, sw.getId() );
|
||||
// s.delete( sw );
|
||||
// s.getTransaction().commit();
|
||||
// s.close();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testInheritance() throws Exception {
|
||||
// Session session = openSession();
|
||||
// Transaction transaction = session.beginTransaction();
|
||||
// String eventPK = "event1";
|
||||
// EventInformation event = ( EventInformation ) session.get( EventInformation.class, eventPK );
|
||||
// if ( event == null ) {
|
||||
// event = new EventInformation();
|
||||
// event.setNotificationId( eventPK );
|
||||
// session.persist( event );
|
||||
// }
|
||||
// String alarmPK = "alarm1";
|
||||
// Alarm alarm = ( Alarm ) session.get( Alarm.class, alarmPK );
|
||||
// if ( alarm == null ) {
|
||||
// alarm = new Alarm();
|
||||
// alarm.setNotificationId( alarmPK );
|
||||
// alarm.setEventInfo( event );
|
||||
// session.persist( alarm );
|
||||
// }
|
||||
// transaction.commit();
|
||||
// session.close();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// @TestForIssue(jiraKey = "HHH-4250")
|
||||
// public void testManyToOneWithJoinTable() {
|
||||
// //HHH-4250 : @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
|
||||
// Session s = openSession();
|
||||
// Transaction tx = s.beginTransaction();
|
||||
//
|
||||
// Client c1 = new Client();
|
||||
// c1.setFirstname( "Firstname1" );
|
||||
// c1.setName( "Name1" );
|
||||
// c1.setCode( "1234" );
|
||||
// c1.setStreet( "Street1" );
|
||||
// c1.setCity( "City1" );
|
||||
//
|
||||
// Account a1 = new Account();
|
||||
// a1.setNumber( "1000" );
|
||||
// a1.setBalance( 5000.0 );
|
||||
//
|
||||
// a1.addClient( c1 );
|
||||
//
|
||||
// s.persist( c1 );
|
||||
// s.persist( a1 );
|
||||
//
|
||||
// s.flush();
|
||||
// s.clear();
|
||||
//
|
||||
// c1 = ( Client ) s.load( Client.class, c1.getId() );
|
||||
// assertEquals( 5000.0, c1.getAccount().getBalance(), 0.01 );
|
||||
//
|
||||
// s.flush();
|
||||
// s.clear();
|
||||
//
|
||||
// a1 = ( Account ) s.load( Account.class, a1.getId() );
|
||||
// Set<Client> clients = a1.getClients();
|
||||
// assertEquals( 1, clients.size() );
|
||||
// Iterator<Client> it = clients.iterator();
|
||||
// c1 = it.next();
|
||||
// assertEquals( "Name1", c1.getName() );
|
||||
//
|
||||
// tx.rollback();
|
||||
// s.close();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// @TestForIssue(jiraKey = "HHH-4240")
|
||||
// public void testSecondaryTables() {
|
||||
// // HHH-4240 - SecondaryTables not recognized when using JOINED inheritance
|
||||
// Session s = openSession();
|
||||
// s.getTransaction().begin();
|
||||
//
|
||||
// Company company = new Company();
|
||||
// company.setCustomerName( "Mama" );
|
||||
// company.setCustomerCode( "123" );
|
||||
// company.setCompanyName( "Mama Mia Pizza" );
|
||||
// company.setCompanyAddress( "Rome" );
|
||||
//
|
||||
// s.persist( company );
|
||||
// s.getTransaction().commit();
|
||||
// s.clear();
|
||||
//
|
||||
// s = openSession();
|
||||
// s.getTransaction().begin();
|
||||
// company = ( Company ) s.get( Company.class, company.getId() );
|
||||
// assertEquals( "Mama", company.getCustomerName() );
|
||||
// assertEquals( "123", company.getCustomerCode() );
|
||||
// assertEquals( "Mama Mia Pizza", company.getCompanyName() );
|
||||
// assertEquals( "Rome", company.getCompanyAddress() );
|
||||
//
|
||||
// s.delete( company );
|
||||
// s.getTransaction().commit();
|
||||
// s.close();
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{
|
||||
return new Class[] {
|
||||
File.class,
|
||||
Folder.class,
|
||||
Document.class,
|
||||
SymbolicLink.class,
|
||||
ProgramExecution.class,
|
||||
Clothing.class,
|
||||
Sweater.class,
|
||||
EventInformation.class,
|
||||
Alarm.class,
|
||||
Client.class,
|
||||
Account.class,
|
||||
Company.class
|
||||
Folder.class
|
||||
// Document.class,
|
||||
// SymbolicLink.class,
|
||||
// ProgramExecution.class,
|
||||
// Clothing.class,
|
||||
// Sweater.class,
|
||||
// EventInformation.class,
|
||||
// Alarm.class,
|
||||
// Client.class,
|
||||
// Account.class,
|
||||
// Company.class
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
@ -33,7 +33,6 @@ import javax.persistence.MappedSuperclass;
|
|||
|
||||
/**
|
||||
* @author Sharath Reddy
|
||||
*
|
||||
*/
|
||||
@MappedSuperclass
|
||||
public class LegalEntity {
|
||||
|
@ -41,7 +40,7 @@ public class LegalEntity {
|
|||
private Long id;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
@ -51,5 +50,4 @@ public class LegalEntity {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
||||
|
@ -20,7 +43,9 @@ public class Parent {
|
|||
private Set propertyAssets = new HashSet();
|
||||
private Set financialAssets = new HashSet();
|
||||
|
||||
@Id @GeneratedValue public Integer getId() {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -28,7 +53,10 @@ public class Parent {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "parent", targetEntity = PropertyAsset.class)
|
||||
@OneToMany(cascade = CascadeType.REFRESH,
|
||||
fetch = FetchType.EAGER,
|
||||
mappedBy = "parent",
|
||||
targetEntity = PropertyAsset.class)
|
||||
public Set getPropertyAssets() {
|
||||
return this.propertyAssets;
|
||||
}
|
||||
|
@ -37,7 +65,10 @@ public class Parent {
|
|||
this.propertyAssets = propertyAssets;
|
||||
}
|
||||
|
||||
@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "parent", targetEntity = FinancialAsset.class)
|
||||
@OneToMany(cascade = CascadeType.REFRESH,
|
||||
fetch = FetchType.EAGER,
|
||||
mappedBy = "parent",
|
||||
targetEntity = FinancialAsset.class)
|
||||
public Set getFinancialAssets() {
|
||||
return this.financialAssets;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
|
@ -13,10 +36,11 @@ import javax.persistence.SecondaryTable;
|
|||
*/
|
||||
@Entity
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@SecondaryTable(name="POOL_ADDRESS")
|
||||
@org.hibernate.annotations.Table(appliesTo="POOL_ADDRESS", optional=true)
|
||||
@SecondaryTable(name = "POOL_ADDRESS")
|
||||
@org.hibernate.annotations.Table(appliesTo = "POOL_ADDRESS", optional = true)
|
||||
public class Pool {
|
||||
@Id @GeneratedValue
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Integer id;
|
||||
|
||||
@Embedded
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
@ -5,14 +28,14 @@ import javax.persistence.Embeddable;
|
|||
|
||||
@Embeddable
|
||||
public class PoolAddress {
|
||||
@Column(table = "POOL_ADDRESS")
|
||||
private String address;
|
||||
@Column(table = "POOL_ADDRESS")
|
||||
private String address;
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.PrimaryKeyJoinColumn;
|
||||
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
//$Id$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2008, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* 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, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY 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
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.annotations.inheritance.joined;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
|
|
Loading…
Reference in New Issue