当前位置: 首页>>代码示例>>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;未经允许,请勿转载。