本文整理匯總了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);
}