当前位置: 首页>>代码示例>>Java>>正文


Java EnumType.STRING属性代码示例

本文整理汇总了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++;
			}
		}
	}
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:24,代码来源:HibernateChecker.java

示例2: valueOf

public static EnumType valueOf(ENUM_TYPE en) {
	switch (en) {
		case ORDINAL: return EnumType.ORDINAL;
		case STRING: return EnumType.STRING;
		default: return null;
	}
}
 
开发者ID:osonus,项目名称:oson,代码行数:7,代码来源:Oson.java

示例3: getType

/**
 * Getter for property type.
 * 
 * @return Value of property type.
 */
@Enumerated(EnumType.STRING)
@Column(nullable = false)
public LogItemType getType() {

    return this.type;
}
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:11,代码来源:LogItem.java

示例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;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:11,代码来源:GrupoVO.java

示例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;
}
 
开发者ID:RBGKew,项目名称:powop,代码行数:7,代码来源:Image.java

示例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;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:7,代码来源:PessoaVO.java

示例7: getRole

@Id
@Enumerated(EnumType.STRING)	
public com.amazon.photosharing.enums.Role getRole() {return this._role;}
 
开发者ID:awslabs,项目名称:aws-photosharing-example,代码行数:3,代码来源:Role.java

示例8: getTipo

@Enumerated(EnumType.STRING)
@Column(name = "tipo", nullable = false)
public TipoEnum getTipo() {
	return tipo;
}
 
开发者ID:m4rciosouza,项目名称:ponto-inteligente-api,代码行数:5,代码来源:Lancamento.java

示例9: getPerfil

@Enumerated(EnumType.STRING)
@Column(name = "perfil", nullable = false)
public PerfilEnum getPerfil() {
	return perfil;
}
 
开发者ID:m4rciosouza,项目名称:ponto-inteligente-api,代码行数:5,代码来源:Funcionario.java

示例10: getGender

@Enumerated(EnumType.STRING)
public Gender getGender() {
	return gender;
}
 
开发者ID:appNG,项目名称:appng-examples,代码行数:4,代码来源:Person.java

示例11: getDataType

@Enumerated(EnumType.STRING)
@Column(name="TYPE", nullable = false)
public DataType getDataType() {
	return dataType;
}
 
开发者ID:witchpou,项目名称:lj-projectbuilder,代码行数:5,代码来源:AttributeEntity.java

示例12: getRecordType

@Enumerated(EnumType.STRING)
@Column(nullable=false, updatable=false)
public LOSUnitLoadRecordType getRecordType() {
	return recordType;
}
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:5,代码来源:LOSUnitLoadRecord.java

示例13: getTipoPessoa

@NotNull
@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 10, name = "tipo_pessoa")
public TipoPessoa getTipoPessoa() {
	return tipoPessoa;
}
 
开发者ID:marcelothebuilder,项目名称:webpedidos,代码行数:6,代码来源:Cliente.java

示例14: getAllocationState

@Access(AccessType.PROPERTY)
@Column(name = "allocation_state")
@Enumerated(value = EnumType.STRING)
public AllocationState getAllocationState() {
    return super.getAllocationState();
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:6,代码来源:Zone.java

示例15: getHashType

/**
 * @return the hashType
 */
@Column(name = "hashType", nullable = true)
@Enumerated(EnumType.STRING)
public MCRPasswordHashType getHashType() {
    return password == null ? null : password.hashType;
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:8,代码来源:MCRUser.java


注:本文中的javax.persistence.EnumType.STRING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。