HHH-10273 : Explicitly put column/table names that are DB2 keywords in quotes

(cherry picked from commit 642d42dc92)
This commit is contained in:
Gail Badner 2015-11-16 18:10:11 -08:00
parent e6e87517d1
commit 54a8b96251
10 changed files with 17 additions and 0 deletions

View File

@ -11,11 +11,13 @@ import javax.persistence.IdClass;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns; import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.Table;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity
@Table(name = "`Dependent`")
@IdClass(DependentId.class) @IdClass(DependentId.class)
public class Dependent { public class Dependent {
@Id @Id

View File

@ -12,11 +12,13 @@ import javax.persistence.IdClass;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns; import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.Table;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity
@Table(name = "`Dependent`")
@IdClass(DependentId.class) @IdClass(DependentId.class)
public class Dependent { public class Dependent {
@Id @Id

View File

@ -13,11 +13,13 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns; import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.MapsId; import javax.persistence.MapsId;
import javax.persistence.Table;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@Entity @Entity
@Table(name="`Dependent`")
public class Dependent { public class Dependent {
// default column name for "name" attribute is overridden // default column name for "name" attribute is overridden
@AttributeOverride(name = "name", column = @Column(name = "dep_name")) @AttributeOverride(name = "name", column = @Column(name = "dep_name"))

View File

@ -4,8 +4,10 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.MapsId; import javax.persistence.MapsId;
import javax.persistence.Table;
@Entity @Entity
@Table(name="`Dependent`")
public class Dependent { public class Dependent {
@EmbeddedId @EmbeddedId

View File

@ -1,5 +1,6 @@
package org.hibernate.test.annotations.derivedidentities.e3.b2; package org.hibernate.test.annotations.derivedidentities.e3.b2;
import javax.persistence.Column;
import javax.persistence.Embeddable; import javax.persistence.Embeddable;
import java.io.Serializable; import java.io.Serializable;

View File

@ -4,8 +4,10 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.MapsId; import javax.persistence.MapsId;
import javax.persistence.Table;
@Entity @Entity
@Table(name="`Policy`")
public class Policy { public class Policy {
@EmbeddedId @EmbeddedId
PolicyId id; PolicyId id;

View File

@ -1,10 +1,12 @@
package org.hibernate.test.annotations.derivedidentities.e3.b2; package org.hibernate.test.annotations.derivedidentities.e3.b2;
import javax.persistence.Column;
import javax.persistence.Embeddable; import javax.persistence.Embeddable;
import java.io.Serializable; import java.io.Serializable;
@Embeddable @Embeddable
public class PolicyId implements Serializable { public class PolicyId implements Serializable {
@Column(name = "`type`", length = 32)
String type; String type;
DependentId depPK; DependentId depPK;
} }

View File

@ -3,6 +3,7 @@ package org.hibernate.test.annotations.derivedidentities.e3.b3;
import javax.persistence.*; import javax.persistence.*;
@Entity @Entity
@Table(name="`Dependent`")
public class Dependent { public class Dependent {
@EmbeddedId @EmbeddedId

View File

@ -3,6 +3,7 @@ package org.hibernate.test.annotations.derivedidentities.e3.b3;
import javax.persistence.*; import javax.persistence.*;
@Entity @Entity
@Table(name="`Policy`")
public class Policy { public class Policy {
@EmbeddedId @EmbeddedId
PolicyId id; PolicyId id;

View File

@ -1,10 +1,12 @@
package org.hibernate.test.annotations.derivedidentities.e3.b3; package org.hibernate.test.annotations.derivedidentities.e3.b3;
import javax.persistence.Column;
import javax.persistence.Embeddable; import javax.persistence.Embeddable;
import java.io.Serializable; import java.io.Serializable;
@Embeddable @Embeddable
public class PolicyId implements Serializable { public class PolicyId implements Serializable {
@Column(name="`type`")
String type; String type;
DependentId depPK; DependentId depPK;
} }