本文整理汇总了Java中javax.persistence.EnumType.STRING属性的典型用法代码示例。如果您正苦于以下问题:Java EnumType.STRING属性的具体用法?Java EnumType.STRING怎么用?Java EnumType.STRING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.persistence.EnumType
的用法示例。
在下文中一共展示了EnumType.STRING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkEnumMapping
/**
* Enums must be mapped as String, not ORDINAL.
* @param g
*/
private void checkEnumMapping(Method g) {
if(Enum.class.isAssignableFrom(g.getReturnType())) { // Is type enum?
if(g.getAnnotation(Transient.class) != null)
return;
//-- If the enum has a @Type we will have to assume the type handles mapping correctly (like MappedEnumType)
org.hibernate.annotations.Type ht = g.getAnnotation(Type.class);
if(null == ht) {
//-- No @Type mapping, so this must have proper @Enumerated definition.
Enumerated e = g.getAnnotation(Enumerated.class);
if(null == e) {
problem(Severity.ERROR, "Missing @Enumerated annotation on enum property - this will cause ORDINAL mapping of an enum which is undesirable");
m_enumErrors++;
} else if(e.value() != EnumType.STRING) {
problem(Severity.ERROR, "@Enumerated(ORDINAL) annotation on enum property - this will cause ORDINAL mapping of an enum which is undesirable");
m_enumErrors++;
}
}
}
}
示例2: valueOf
public static EnumType valueOf(ENUM_TYPE en) {
switch (en) {
case ORDINAL: return EnumType.ORDINAL;
case STRING: return EnumType.STRING;
default: return null;
}
}
示例3: getType
/**
* Getter for property type.
*
* @return Value of property type.
*/
@Enumerated(EnumType.STRING)
@Column(nullable = false)
public LogItemType getType() {
return this.type;
}
示例4: getAuthorities
/**
*
* @return
*/
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable(name = "grupo_autorities")
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
示例5: getSubjectPart
@ElementCollection
@CollectionTable(name="image_SubjectPart", [email protected](name="image_id"))
@Column(name="subjectPart")
@Enumerated(value = EnumType.STRING)
public Set<DescriptionType> getSubjectPart() {
return subjectPart;
}
示例6: getAuthorities
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable(name = "pessoa_autorities")
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
示例7: getRole
@Id
@Enumerated(EnumType.STRING)
public com.amazon.photosharing.enums.Role getRole() {return this._role;}
示例8: getTipo
@Enumerated(EnumType.STRING)
@Column(name = "tipo", nullable = false)
public TipoEnum getTipo() {
return tipo;
}
示例9: getPerfil
@Enumerated(EnumType.STRING)
@Column(name = "perfil", nullable = false)
public PerfilEnum getPerfil() {
return perfil;
}
示例10: getGender
@Enumerated(EnumType.STRING)
public Gender getGender() {
return gender;
}
示例11: getDataType
@Enumerated(EnumType.STRING)
@Column(name="TYPE", nullable = false)
public DataType getDataType() {
return dataType;
}
示例12: getRecordType
@Enumerated(EnumType.STRING)
@Column(nullable=false, updatable=false)
public LOSUnitLoadRecordType getRecordType() {
return recordType;
}
示例13: getTipoPessoa
@NotNull
@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 10, name = "tipo_pessoa")
public TipoPessoa getTipoPessoa() {
return tipoPessoa;
}
示例14: getAllocationState
@Access(AccessType.PROPERTY)
@Column(name = "allocation_state")
@Enumerated(value = EnumType.STRING)
public AllocationState getAllocationState() {
return super.getAllocationState();
}
示例15: getHashType
/**
* @return the hashType
*/
@Column(name = "hashType", nullable = true)
@Enumerated(EnumType.STRING)
public MCRPasswordHashType getHashType() {
return password == null ? null : password.hashType;
}