EJB-405 - Changed the column name for properties which are reserved keywords in some databases

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15677 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Juraci Krohling 2008-12-10 12:05:04 +00:00
parent 468743d2a7
commit 8719e10c1c
4 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import org.hibernate.annotations.IndexColumn;
@Entity @Entity
public class Race { public class Race {
@Id @GeneratedValue public Integer id; @Id @GeneratedValue public Integer id;
@IndexColumn( name="index" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @IndexColumn( name="index_" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) @org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public List<Competitor> competitors = new ArrayList<Competitor>(); public List<Competitor> competitors = new ArrayList<Competitor>();
public String name; public String name;

View File

@ -1,6 +1,7 @@
//$Id$ //$Id$
package org.hibernate.ejb.test.inheritance; package org.hibernate.ejb.test.inheritance;
import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
/** /**
@ -10,6 +11,7 @@ import javax.persistence.Entity;
public class Strawberry extends Fruit { public class Strawberry extends Fruit {
private Long size; private Long size;
@Column(name="size_")
public Long getSize() { public Long getSize() {
return size; return size;
} }

View File

@ -9,7 +9,7 @@ import javax.persistence.Version;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity(name="Lock_")
public class Lock { public class Lock {
private Integer id; private Integer id;
private Integer version; private Integer version;

View File

@ -1,6 +1,7 @@
//$Id$ //$Id$
package org.hibernate.ejb.test.ops; package org.hibernate.ejb.test.ops;
import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
@ -14,5 +15,6 @@ public class Workload {
@GeneratedValue @GeneratedValue
public Integer id; public Integer id;
public String name; public String name;
@Column(name="load_")
public Integer load; public Integer load;
} }