本文整理匯總了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;
}