當前位置: 首頁>>代碼示例>>Java>>正文


Java NamedQueries類代碼示例

本文整理匯總了Java中javax.persistence.NamedQueries的典型用法代碼示例。如果您正苦於以下問題:Java NamedQueries類的具體用法?Java NamedQueries怎麽用?Java NamedQueries使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NamedQueries類屬於javax.persistence包,在下文中一共展示了NamedQueries類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getNamedQueries

import javax.persistence.NamedQueries; //導入依賴的package包/類
private NamedQueries getNamedQueries(Element tree, XMLContext.Default defaults) {
	//TODO avoid the Proxy Creation (@NamedQueries) when possible
	List<NamedQuery> queries = (List<NamedQuery>) buildNamedQueries( tree, false, defaults );
	if ( defaults.canUseJavaAnnotations() ) {
		NamedQuery annotation = getPhysicalAnnotation( NamedQuery.class );
		addNamedQueryIfNeeded( annotation, queries );
		NamedQueries annotations = getPhysicalAnnotation( NamedQueries.class );
		if ( annotations != null ) {
			for ( NamedQuery current : annotations.value() ) {
				addNamedQueryIfNeeded( current, queries );
			}
		}
	}
	if ( queries.size() > 0 ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( NamedQueries.class );
		ad.setValue( "value", queries.toArray( new NamedQuery[queries.size()] ) );
		return AnnotationFactory.create( ad );
	}
	else {
		return null;
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:23,代碼來源:JPAOverriddenAnnotationReader.java

示例2: createNamedQueries

import javax.persistence.NamedQueries; //導入依賴的package包/類
public XAnnotation<?> createNamedQueries(
		Collection<NamedQuery> cNamedQueries) {
	return transform(
			NamedQueries.class,
			javax.persistence.NamedQuery.class,
			cNamedQueries,
			new Transformer<NamedQuery, XAnnotation<javax.persistence.NamedQuery>>() {
				public XAnnotation<javax.persistence.NamedQuery> transform(
						NamedQuery input) {
					return createNamedQuery(input);
				}
			});
}
 
開發者ID:highsource,項目名稱:hyperjaxb3,代碼行數:14,代碼來源:CreateXAnnotations.java

示例3: getQueryString

import javax.persistence.NamedQueries; //導入依賴的package包/類
public String getQueryString(String namedQueryName) {
	NamedQueries namedQueries = (NamedQueries) entityClass.getAnnotation(NamedQueries.class);
	for (NamedQuery namedQuery : namedQueries.value()) {
		if (namedQuery.name().equals(namedQueryName)) return namedQuery.query();
	}
	throw new QueryException("Named query " + namedQueryName + " not found in class " + entityClass.getName());
}
 
開發者ID:ivmarcos,項目名稱:query,代碼行數:8,代碼來源:Reflection.java

示例4: bindQueries

import javax.persistence.NamedQueries; //導入依賴的package包/類
public static void bindQueries(NamedQueries queriesAnn, Mappings mappings, boolean isDefault) {
	if ( queriesAnn == null ) return;
	for (NamedQuery q : queriesAnn.value()) {
		bindQuery( q, mappings, isDefault );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:QueryBinder.java


注:本文中的javax.persistence.NamedQueries類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。