HHH-7717 Wrapped additional "type" column names into "`type`" as they
can be reserved in some dialects which would cause a test failure.
This commit is contained in:
parent
76bb63c74c
commit
d41b800bb0
|
@ -1,72 +1,74 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
|
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Inc.
|
* distributed under license by Red Hat Inc.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.annotations.collectionelement.embeddables.withcustomenumdef;
|
package org.hibernate.test.annotations.collectionelement.embeddables.withcustomenumdef;
|
||||||
|
|
||||||
import javax.persistence.Embeddable;
|
import javax.persistence.Embeddable;
|
||||||
import javax.persistence.EnumType;
|
import javax.persistence.EnumType;
|
||||||
import javax.persistence.Enumerated;
|
import javax.persistence.Enumerated;
|
||||||
|
import javax.persistence.Column;
|
||||||
/**
|
|
||||||
* @author Steve Ebersole
|
/**
|
||||||
*/
|
* @author Steve Ebersole
|
||||||
@Embeddable
|
*/
|
||||||
public class Location {
|
@Embeddable
|
||||||
public static enum Type {
|
public class Location {
|
||||||
POSTAL_CODE,
|
public static enum Type {
|
||||||
COMMUNE,
|
POSTAL_CODE,
|
||||||
REGION,
|
COMMUNE,
|
||||||
PROVINCE,
|
REGION,
|
||||||
COUNTY
|
PROVINCE,
|
||||||
}
|
COUNTY
|
||||||
|
}
|
||||||
private String name;
|
|
||||||
|
private String name;
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
// @Column(columnDefinition = "VARCHAR(32)")
|
@Enumerated(EnumType.STRING)
|
||||||
private Type type;
|
// @Column(columnDefinition = "VARCHAR(32)")
|
||||||
|
@Column(name = "`type`")
|
||||||
public Location() {
|
private Type type;
|
||||||
}
|
|
||||||
|
public Location() {
|
||||||
public Location(String name, Type type) {
|
}
|
||||||
this.name = name;
|
|
||||||
this.type = type;
|
public Location(String name, Type type) {
|
||||||
}
|
this.name = name;
|
||||||
|
this.type = type;
|
||||||
public Type getType() {
|
}
|
||||||
return type;
|
|
||||||
}
|
public Type getType() {
|
||||||
|
return type;
|
||||||
public void setType(Type type) {
|
}
|
||||||
this.type = type;
|
|
||||||
}
|
public void setType(Type type) {
|
||||||
|
this.type = type;
|
||||||
public String getName() {
|
}
|
||||||
return name;
|
|
||||||
}
|
public String getName() {
|
||||||
|
return name;
|
||||||
public void setName(String name) {
|
}
|
||||||
this.name = name;
|
|
||||||
}
|
public void setName(String name) {
|
||||||
}
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,32 +1,34 @@
|
||||||
//$Id$
|
//$Id$
|
||||||
package org.hibernate.test.annotations.embedded;
|
package org.hibernate.test.annotations.embedded;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Column;
|
||||||
/**
|
|
||||||
* @author Emmanuel Bernard
|
/**
|
||||||
*/
|
* @author Emmanuel Bernard
|
||||||
@Entity
|
*/
|
||||||
public class CorpType {
|
@Entity
|
||||||
private Integer id;
|
public class CorpType {
|
||||||
private String type;
|
private Integer id;
|
||||||
|
@Column(name = "`type`")
|
||||||
@Id
|
private String type;
|
||||||
@GeneratedValue
|
|
||||||
public Integer getId() {
|
@Id
|
||||||
return id;
|
@GeneratedValue
|
||||||
}
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
public void setId(Integer id) {
|
}
|
||||||
this.id = id;
|
|
||||||
}
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
public String getType() {
|
}
|
||||||
return type;
|
|
||||||
}
|
public String getType() {
|
||||||
|
return type;
|
||||||
public void setType(String type) {
|
}
|
||||||
this.type = type;
|
|
||||||
}
|
public void setType(String type) {
|
||||||
}
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue