當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。