本文整理汇总了Java中org.hibernate.criterion.DetachedCriteria.createAlias方法的典型用法代码示例。如果您正苦于以下问题:Java DetachedCriteria.createAlias方法的具体用法?Java DetachedCriteria.createAlias怎么用?Java DetachedCriteria.createAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.criterion.DetachedCriteria
的用法示例。
在下文中一共展示了DetachedCriteria.createAlias方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareItemQuery
import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@Override
public void prepareItemQuery(ItemSerializerState state)
{
final DetachedCriteria criteria = state.getItemQuery();
final ProjectionList projection = state.getItemProjection();
if( state.hasCategory(ItemSerializerService.CATEGORY_BASIC) )
{
projection.add(Projections.property("name.id"), NAME_ALIAS);
projection.add(Projections.property("description.id"), DESC_ALIAS);
}
if( state.hasCategory(ItemSerializerService.CATEGORY_METADATA) )
{
criteria.createAlias("itemXml", "itemXml");
projection.add(Projections.property("itemXml.xml"), METADATA_ALIAS);
}
}
示例2: loadComponentConfigsByName
import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigsByName(String profileKey) {
DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
dc.add(Restrictions.eq("name", profileKey));
dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
dc.addOrder(Order.asc("m.order"));
return (List<ComponentConfig>) this.query(dc);
}
示例3: loadComponentConfig
import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public ComponentConfig loadComponentConfig(String controlId, String name) {
DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
dc.add(Restrictions.eq("name", name));
dc.add(Restrictions.eq("controlId", controlId));
dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
dc.addOrder(Order.asc("m.order"));
List<ComponentConfig> componentConfigs = (List<ComponentConfig>) this.query(dc);
return componentConfigs.isEmpty() ? null : componentConfigs.get(0);
}
示例4: loadComponentConfigsByViewName
import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigsByViewName(String viewName) {
DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
dc.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
dc.add(Restrictions.like("controlId", viewName + ".%"));
dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
dc.addOrder(Order.asc("m.order"));
return (List<ComponentConfig>) this.query(dc);
}
示例5: loadComponentConfigs
import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigs() {
DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
dc.addOrder(Order.asc("m.order"));
return (List<ComponentConfig>) this.query(dc);
}