Java Code Examples for javax.persistence.EnumType#valueOf()

The following examples show how to use javax.persistence.EnumType#valueOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JPAOverriddenAnnotationReader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a @MapKeyEnumerated annotation to the specified annotationList if the specified element
 * contains a map-key-enumerated sub-element. This should only be the case for
 * element-collection, many-to-many, or one-to-many associations.
 */
private void getMapKeyEnumerated(List<Annotation> annotationList, Element element) {
	Element subelement = element != null ? element.element( "map-key-enumerated" ) : null;
	if ( subelement != null ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyEnumerated.class );
		EnumType value = EnumType.valueOf( subelement.getTextTrim() );
		ad.setValue( "value", value );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
Example 2
Source File: CreateXAnnotations.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public XAnnotation<javax.persistence.Enumerated> createEnumerated(
		String cEnumerated) {
	return cEnumerated == null ? null :
	//
			new XAnnotation<javax.persistence.Enumerated>(
					javax.persistence.Enumerated.class,
					//
					new XSingleAnnotationField<EnumType>("value",
							EnumType.class,
							new XEnumAnnotationValue<EnumType>(
									EnumType.valueOf(cEnumerated))));
}
 
Example 3
Source File: MethodBean.java    From opscenter with Apache License 2.0 4 votes vote down vote up
public void setSqlType(String sqlType) {
	this.sqlType = EnumType.valueOf(MethodType.class, sqlType);
}