精华内容
下载资源
问答
  • 如果您正苦於以下問題:Java Criterion具體用法?Java Criterion怎麽用?Java Criterion使用例子?那麽恭喜您, 這裏精選類代碼示例或許可以為您提供幫助。Criterion類屬於com.liferay.portal.kerne...

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

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

    示例1: executeDynamicQuery

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public static List> executeDynamicQuery(

    Service service, Criterion criterion, Projection projection,

    List orders)

    throws Exception {

    DynamicQuery query = service.newDynamicQuery();

    if (projection != null) {

    query.setProjection(projection);

    }

    if (orders != null) {

    for (Order order : orders) {

    query.addOrder(order);

    }

    }

    if (criterion != null) {

    query.add(criterion);

    }

    return service.executeDynamicQuery(query);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:24,

    示例2: count

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public long count(Criterion criterion) {

    try {

    List> list = executeDynamicQuery(

    criterion, ProjectionFactoryUtil.rowCount());

    if (list != null) {

    return (Long)list.get(0);

    }

    }

    catch (Exception e) {

    _log.error(

    "Error executing count for " + getName() + ": " +

    e.getMessage());

    }

    return -1;

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:19,

    示例3: getFilteredModel

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public Model getFilteredModel(Criterion criterion, String nameSuffix) {

    if (criterion == null) {

    return this;

    }

    if (count(criterion)==-1) {

    return null;

    }

    ModelWrapper modelWrapper = new ModelWrapper(this);

    modelWrapper.setCriterion(criterion);

    if (Validator.isNotNull(nameSuffix)) {

    modelWrapper.setNameSuffix(nameSuffix);

    }

    return modelWrapper;

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:20,

    示例4: getMostUsedSearchStringNotNull

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public List getMostUsedSearchStringNotNull() {

    try {

    DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Logging.class);

    Criterion criterion = RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.like("searchString", "null"));

    dynamicQuery.add(criterion);

    Order defaultOrder = OrderFactoryUtil.desc("passel");

    dynamicQuery.addOrder(defaultOrder);

    return dynamicQuery(dynamicQuery);

    } catch (SystemException e) {

    e.printStackTrace();

    }

    return null;

    }

    開發者ID:fraunhoferfokus,項目名稱:govapps,代碼行數:18,

    示例5: getMostViewdApplications

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public List getMostViewdApplications() {

    try {

    DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);

    Criterion criterion = RestrictionsFactoryUtil.gt("detailsViewed", new Long(0));

    dynamicQuery.add(criterion);

    Order defaultOrder = OrderFactoryUtil.desc("detailsViewed");

    dynamicQuery.addOrder(defaultOrder);

    return dynamicQuery(dynamicQuery);

    } catch (SystemException e) {

    e.printStackTrace();

    }

    return null;

    }

    開發者ID:fraunhoferfokus,項目名稱:govapps,代碼行數:18,

    示例6: getMostClickedApplications

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public List getMostClickedApplications() {

    try {

    DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);

    Criterion criterion = RestrictionsFactoryUtil.gt("linkClicked", new Long(0));

    dynamicQuery.add(criterion);

    Order defaultOrder = OrderFactoryUtil.desc("linkClicked");

    dynamicQuery.addOrder(defaultOrder);

    return dynamicQuery(dynamicQuery);

    } catch (SystemException e) {

    e.printStackTrace();

    }

    return null;

    }

    開發者ID:fraunhoferfokus,項目名稱:govapps,代碼行數:18,

    示例7: getRelAppIds

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public List getRelAppIds(long appId) throws SystemException {

    List result = new ArrayList();

    DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RelatedApplications.class);

    Criterion criterionOr = null;

    criterionOr = RestrictionsFactoryUtil.or(RestrictionsFactoryUtil.eq("applicationId", appId), RestrictionsFactoryUtil.eq("applicationId2", appId));

    dynamicQuery.add(criterionOr);

    List relatedApplicationsList = dynamicQuery(dynamicQuery);

    for (RelatedApplications relatedApplications: relatedApplicationsList) {

    if (relatedApplications.getApplicationId() == appId && !result.contains(relatedApplications.getApplicationId2() )) {

    result.add(relatedApplications.getApplicationId2());

    }

    if (relatedApplications.getApplicationId2() == appId && !result.contains(relatedApplications.getApplicationId() )) {

    result.add(relatedApplications.getApplicationId());

    }

    }

    return result;

    }

    開發者ID:fraunhoferfokus,項目名稱:govapps,代碼行數:22,

    示例8: getPreviusModule

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Module getPreviusModule(Module theModule) throws SystemException {

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(Module.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("ordern").lt(theModule.getOrdern());

    dq.add(criterion);

    criterion=PropertyFactoryUtil.forName("groupId").eq(theModule.getGroupId());

    dq.add(criterion);

    Order createOrder=OrderFactoryUtil.getOrderFactory().desc("ordern");

    dq.addOrder(createOrder);

    @SuppressWarnings("unchecked")

    List modulesp=(List)moduleLocalService.dynamicQuery(dq,0,1);

    if(modulesp!=null&& modulesp.size()>0)

    {

    return modulesp.get(0);

    }

    else

    {

    return null;

    }

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:22,

    示例9: getNextModule

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Module getNextModule(Module theModule) throws SystemException {

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(Module.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("ordern").gt(theModule.getOrdern());

    dq.add(criterion);

    criterion=PropertyFactoryUtil.forName("groupId").eq(theModule.getGroupId());

    dq.add(criterion);

    Order createOrder=OrderFactoryUtil.getOrderFactory().asc("ordern");

    dq.addOrder(createOrder);

    @SuppressWarnings("unchecked")

    List modulesp=(List)moduleLocalService.dynamicQuery(dq,0,1);

    if(modulesp!=null&& modulesp.size()>0)

    {

    return modulesp.get(0);

    }

    else

    {

    return null;

    }

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:22,

    示例10: findByclassName_classPK_filterByActions

    ​點讚 3

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @SuppressWarnings("unchecked")

    public List findByclassName_classPK_filterByActions(String className, long classPK, List actions)

    throws SystemException

    {

    DynamicQuery dq = auditEntryLocalService.dynamicQuery();

    Criterion criterion=PropertyFactoryUtil.forName("classname").eq(className);

    if(classPK>0)

    {

    criterion=RestrictionsFactoryUtil.and(criterion, PropertyFactoryUtil.forName("classPK").eq(classPK));

    }

    Criterion criterionAux = criterion;

    for (int i=0; i

    if(i==0){

    criterion = RestrictionsFactoryUtil.and(criterion, PropertyFactoryUtil.forName("action").eq(actions.get(i)));

    }else{

    Criterion criterionAnd = RestrictionsFactoryUtil.and(criterionAux , PropertyFactoryUtil.forName("action").eq(actions.get(i)));

    criterion = RestrictionsFactoryUtil.or(criterion, criterionAnd);

    }

    }

    dq.add(criterion);

    return auditEntryLocalService.dynamicQuery(dq);

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:24,

    示例11: getDataWithDuplicatesWithCache

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Map> getDataWithDuplicatesWithCache(

    Map>> queryCache, Model relatedModel,

    List relatedAttributes, List mappingsRelated,

    Criterion relatedCriterion)

    throws Exception {

    Map> relatedMap;

    String attributes = Arrays.toString(relatedAttributes.toArray());

    String cacheKey =

    relatedModel.getName() + "_" + attributes + "_key_" +

    mappingsRelated.get(0);

    relatedMap = queryCache.get(cacheKey);

    if (relatedMap == null) {

    synchronized(relatedModel) {

    relatedMap = queryCache.get(cacheKey);

    if (relatedMap == null) {

    relatedMap = Query.getDataWithDuplicates(

    relatedModel, relatedAttributes.toArray(new String[0]),

    mappingsRelated.get(0), relatedCriterion);

    queryCache.put(cacheKey, relatedMap);

    }

    }

    }

    return relatedMap;

    }

    開發者ID:jorgediaz-lr,項目名稱:staging-checker,代碼行數:33,

    示例12: getAttributeRangeCriterion

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    protected Criterion getAttributeRangeCriterion(

    Model model, String attribute, Object value, boolean isStartValue) {

    if (!model.hasAttribute(attribute)) {

    return RestrictionsFactoryUtil.disjunction();

    }

    Property property = model.getProperty(attribute);

    if (isStartValue) {

    return property.ge(value);

    }

    return property.lt(value);

    }

    開發者ID:jorgediaz-lr,項目名稱:staging-checker,代碼行數:16,

    示例13: generateSQLCriterion

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public static Criterion generateSQLCriterion(String sql) {

    if (Validator.isNull(sql)) {

    return null;

    }

    sql = PortalUtil.transformSQL(sql);

    return RestrictionsFactoryUtil.sqlRestriction(sql);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:10,

    示例14: addCriterion

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public void addCriterion(Criterion criterion) {

    if (serviceWrapper == null) {

    serviceWrapper = new ServiceWrapper(model.getService());

    }

    serviceWrapper.addCriterion(criterion);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:8,

    示例15: executeDynamicQuery

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public List> executeDynamicQuery(Criterion criterion, Order order)

    throws Exception {

    List orders = Collections.singletonList(order);

    return executeDynamicQuery(criterion, null, orders);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:9,

    示例16: getFilteredModel

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public Model getFilteredModel(Criterion criterion, String nameSuffix) {

    if (serviceWrapper != null) {

    criterion = ModelUtil.generateConjunctionCriterion(

    criterion, serviceWrapper.getCriterion());

    }

    return model.getFilteredModel(criterion, nameSuffix);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:10,

    示例17: setCriterion

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public void setCriterion(Criterion criterion) {

    if (count(criterion)==-1) {

    throw new IllegalArgumentException();

    }

    if (serviceWrapper == null) {

    serviceWrapper = new ServiceWrapper(model.getService());

    }

    serviceWrapper.setCriterion(criterion);

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:12,

    示例18: getAttributeCriterion

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public Criterion getAttributeCriterion(String attribute, List list) {

    if (!this.hasAttribute(attribute) || Validator.isNull(list)) {

    return null;

    }

    Property property = getProperty(attribute);

    if (list.size() == 1) {

    return property.eq(list.get(0));

    }

    int maxNumClauses = MAX_NUMBER_OF_CLAUSES;

    if (list.size() <= maxNumClauses) {

    return property.in(list);

    }

    Disjunction disjunction = RestrictionsFactoryUtil.disjunction();

    int numberOfDisjuntions =

    ((list.size() + maxNumClauses - 1) / maxNumClauses);

    for (int i = 0; i

    int start = i * maxNumClauses;

    int end = Math.min(start + maxNumClauses, list.size());

    List subList = list.subList(start, end);

    disjunction.add(property.in(subList));

    }

    return disjunction;

    }

    開發者ID:jorgediaz-lr,項目名稱:servicebuilder-reflection,代碼行數:35,

    示例19: getLiferayData

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @Override

    public Map getLiferayData(Model model, List groupIds)

    throws Exception {

    if (indexAllVersions) {

    return super.getLiferayData(model, groupIds);

    }

    Criterion criterion = model.getAttributeCriterion("groupId", groupIds);

    Collection attributesToQuery =

    ConfigurationUtil.getModelAttributesToQuery(model);

    String[] attributesToQueryArr = attributesToQuery.toArray(

    new String[0]);

    Map dataMap = new HashMap();

    Criterion criterionStatusApproved = ModelUtil.generateSQLCriterion(

    "status=" + WorkflowConstants.STATUS_APPROVED + " or status=" +

    WorkflowConstants.STATUS_IN_TRASH);

    addMissingJournalArticles(

    model, attributesToQueryArr, criterion, criterionStatusApproved,

    dataMap);

    Criterion criterionStatusNotApproved = ModelUtil.generateSQLCriterion(

    "status<>" + WorkflowConstants.STATUS_APPROVED + " or status<>" +

    WorkflowConstants.STATUS_IN_TRASH);

    addMissingJournalArticles(

    model, attributesToQueryArr, criterion, criterionStatusNotApproved,

    dataMap);

    return dataMap;

    }

    開發者ID:jorgediaz-lr,項目名稱:index-checker,代碼行數:37,

    示例20: avgResult

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Double avgResult(long actId) throws SystemException

    {

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("actId").eq(actId);

    dq.add(criterion);

    criterion=PropertyFactoryUtil.forName("endDate").isNotNull();

    dq.add(criterion);

    dq.setProjection(ProjectionFactoryUtil.avg("result"));

    return (Double)(learningActivityResultPersistence.findWithDynamicQuery(dq).get(0));

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:12,

    示例21: getLastEndDateByUserId

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Date getLastEndDateByUserId(long userId) throws SystemException{

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("userId").eq(userId);

    dq.add(criterion);

    criterion=PropertyFactoryUtil.forName("endDate").isNotNull();

    dq.add(criterion);

    dq.setProjection(ProjectionFactoryUtil.max("endDate"));

    return (Date)(learningActivityResultPersistence.findWithDynamicQuery(dq).get(0));

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:11,

    示例22: getLastEndDateByUserIdCourseId

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Date getLastEndDateByUserIdCourseId(long userId, long courseId) throws SystemException

    {

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dqCourse=DynamicQueryFactoryUtil.forClass(Course.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("courseId").eq(courseId);

    dqCourse.add(criterion);

    dqCourse.setProjection(ProjectionFactoryUtil.property("groupCreatedId"));

    DynamicQuery dqModule=DynamicQueryFactoryUtil.forClass(Module.class, classLoader);

    dqModule.add(PropertyFactoryUtil.forName("groupId").in(dqCourse));

    dqModule.setProjection(ProjectionFactoryUtil.property("moduleId"));

    DynamicQuery dqActivity=DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader);

    dqActivity.add(PropertyFactoryUtil.forName("moduleId").in(dqModule));

    dqActivity.setProjection(ProjectionFactoryUtil.property("actId"));

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader);

    criterion=PropertyFactoryUtil.forName("userId").eq(userId);

    dq.add(criterion);

    dq.add(PropertyFactoryUtil.forName("actId").in(dqActivity));

    criterion=PropertyFactoryUtil.forName("endDate").isNotNull();

    dq.add(criterion);

    dq.setProjection(ProjectionFactoryUtil.max("endDate"));

    return (Date)(learningActivityResultPersistence.findWithDynamicQuery(dq).get(0));

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:28,

    示例23: avgResult

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public Double avgResult(long courseId, boolean passed) throws SystemException{

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(CourseResult.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("courseId").eq(courseId);

    dq.add(criterion);

    criterion=PropertyFactoryUtil.forName("passed").eq(passed);

    dq.add(criterion);

    dq.setProjection(ProjectionFactoryUtil.avg("result"));

    return (Double)(learningActivityResultPersistence.findWithDynamicQuery(dq).get(0));

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:12,

    示例24: findByActIdOrderByP2pId

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    @SuppressWarnings("unchecked")

    public List findByActIdOrderByP2pId(long actId)

    throws SystemException {

    try{

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(P2pActivity.class, classLoader);

    Criterion criterion=PropertyFactoryUtil.forName("actId").eq(actId);

    dq.add(criterion);

    Order createOrder=OrderFactoryUtil.getOrderFactory().asc("p2pActivityId");

    dq.addOrder(createOrder);

    List modulesp=(List)P2pActivityLocalServiceUtil.dynamicQuery(dq);

    //auditing

    ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();

    if(serviceContext!=null){

    AuditingLogFactory.audit(serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), P2pActivity.class.getName(),

    actId, serviceContext.getUserId(), AuditConstants.GET, null);

    }else{

    LearningActivity la = learningActivityPersistence.fetchByPrimaryKey(actId);

    if(la!=null){

    AuditingLogFactory.audit(la.getCompanyId(), la.getGroupId(), P2pActivity.class.getName(),

    actId, la.getUserId(), AuditConstants.GET, null);

    }

    }

    return modulesp;

    }

    catch(Exception e){

    if (_log.isErrorEnabled()) {

    _log.error("Error getting P2pActivityLocalService.findByActIdOrderByP2pId");

    _log.error(e.getMessage());

    }

    return null;

    }

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:40,

    示例25: usersStarted

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public long usersStarted(long moduleId) throws SystemException

    {

    ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

    DynamicQuery dq=DynamicQueryFactoryUtil.forClass(LearningActivityTry.class, classLoader);

    java.util.List actIds=LearningActivityLocalServiceUtil.getLearningActivityIdsOfModule(moduleId);

    long result=0;

    Criterion crit;

    crit = PropertyFactoryUtil.forName("actId").in(actIds.toArray());

    dq.add(crit);

    dq.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("userId")));

    result=LearningActivityTryLocalServiceUtil.dynamicQueryCount(dq);

    return result;

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:14,

    示例26: search

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public List search(long companyId, long groupId,String className,long classPK, long userId, Date startDate,Date endDate, int start, int end) throws SystemException

    {

    DynamicQuery dq=auditEntryLocalService.dynamicQuery();

    Criterion criterion=PropertyFactoryUtil.forName("companyId").eq(companyId);

    dq.add(criterion);

    if(groupId>0)

    {

    criterion=PropertyFactoryUtil.forName("groupId").eq(groupId);

    dq.add(criterion);

    }

    if(userId>0)

    {

    criterion=PropertyFactoryUtil.forName("userId").eq(userId);

    dq.add(criterion);

    }

    if(startDate!=null)

    {

    criterion=PropertyFactoryUtil.forName("auditDate").ge(startDate);

    dq.add(criterion);

    }

    if(endDate!=null)

    {

    criterion=PropertyFactoryUtil.forName("auditDate").le(endDate);

    dq.add(criterion);

    }

    if(className!=null)

    {

    criterion=PropertyFactoryUtil.forName("classname").eq(className);

    dq.add(criterion);

    if(classPK>0)

    {

    criterion=PropertyFactoryUtil.forName("classPK").eq(classPK);

    dq.add(criterion);

    }

    }

    dq.addOrder(OrderFactoryUtil.desc("auditDate"));

    return ((List)auditEntryLocalService.dynamicQuery(dq, start, end));

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:39,

    示例27: searchCount

    ​點讚 2

    import com.liferay.portal.kernel.dao.orm.Criterion; //導入依賴的package包/類

    public long searchCount(long companyId, long groupId,String className,long classPK, long userId, Date startDate,Date endDate, int start, int end) throws SystemException

    {

    DynamicQuery dq=auditEntryLocalService.dynamicQuery();

    Criterion criterion=PropertyFactoryUtil.forName("companyId").eq(companyId);

    dq.add(criterion);

    if(groupId>0)

    {

    criterion=PropertyFactoryUtil.forName("groupId").eq(groupId);

    dq.add(criterion);

    }

    if(userId>0)

    {

    criterion=PropertyFactoryUtil.forName("userId").eq(userId);

    dq.add(criterion);

    }

    if(startDate!=null)

    {

    criterion=PropertyFactoryUtil.forName("auditDate").ge(startDate);

    dq.add(criterion);

    }

    if(endDate!=null)

    {

    criterion=PropertyFactoryUtil.forName("auditDate").le(endDate);

    dq.add(criterion);

    }

    if(className!=null)

    {

    criterion=PropertyFactoryUtil.forName("classname").eq(className);

    dq.add(criterion);

    if(classPK>0)

    {

    criterion=PropertyFactoryUtil.forName("classPK").eq(classPK);

    dq.add(criterion);

    }

    }

    return auditEntryLocalService.dynamicQueryCount(dq);

    }

    開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:38,

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

    展开全文
  • 我需要创建一个使用带有多个参数JPA Criteria API搜索方法.现在问题是不是每个参数都是必需.所以有些可能为null,它们不应包含在查询中.我已经用CriteriaBuilder尝试了这个,但我看不出如何让它工作.使用...

    我需要创建一个使用带有多个参数的JPA Criteria API的搜索方法.

    现在的问题是不是每个参数都是必需的.所以有些可能为null,它们不应包含在查询中.我已经用CriteriaBuilder尝试了这个,但我看不出如何让它工作.

    使用Hibernate Criteria API,这非常简单.只需创建条件,然后添加限制.

    Criteria criteria = session.createCriteria(someClass.class);

    if(someClass.getName() != null) {

    criteria.add(Restrictions.like("name", someClass.getName());

    }

    我怎么能用JPA的Criteria API实现同样的目标?

    解决方法:

    要查询的示例实体:

    @Entity

    public class A {

    @Id private Long id;

    String someAttribute;

    String someOtherAttribute;

    ...

    }

    查询本身:

    //some parameters to your method

    String param1 = "1";

    String paramNull = null;

    CriteriaBuilder qb = em.getCriteriaBuilder();

    CriteriaQuery cq = qb.createQuery();

    Root customer = cq.from(A.class);

    //Constructing list of parameters

    List predicates = new ArrayList();

    //Adding predicates in case of parameter not being null

    if (param1 != null) {

    predicates.add(

    qb.equal(customer.get("someAttribute"), param1));

    }

    if (paramNull != null) {

    predicates.add(

    qb.equal(customer.get("someOtherAttribute"), paramNull));

    }

    //query itself

    cq.select(customer)

    .where(predicates.toArray(new Predicate[]{}));

    //execute query and do something with result

    em.createQuery(cq).getResultList();

    标签:criteria-api,java,jpa

    来源: https://codeday.me/bug/20190925/1817375.html

    展开全文
  • Hibernate Criterion是Criteria查询条件。Criteria 提供了add(Criterion criterion)方法来添加查询条件。Criteria 特点来方便地进行查询条件组装。Criteria常用方法:1. 创建一个Criteria 实例org.hibernate...

    Hibernate Criterion是Criteria的查询条件。Criteria 提供了add(Criterion criterion)方法来添加查询条件。Criteria 的特点来方便地进行查询条件的组装。

    Criteria的常用方法:

    1. 创建一个Criteria 实例

    org.hibernate.Criteria接口表示特定持久类的一个查询。Session是 Criteria实例的工厂。

    Criteria crit = sess.createCriteria(Cat.class);

    crit.setMaxResults(50);

    List cats = crit.list();

    2. 限制结果集内容

    一个单独的查询条件是org.hibernate.criterion.Criterion 接口的一个实例。

    org.hibernate.criterion.Restrictions类定义了获得某些内置Criterion类型的工厂方法。

    List cats = sess.createCriteria(Cat.class).add( Restrictions.like("name", "Fritz%") )

    .add( Restrictions.between("weight", minWeight, maxWeight) ).list();

    约束也可以按逻辑分组。

    List cats = sess.createCriteria(Cat.class).add( Restrictions.like("name", "Fritz%") )

    .add( Restrictions.or(

    Restrictions.eq( "age", new Integer(0) ),

    Restrictions.isNull("age")

    ) ).list();

    List cats = sess.createCriteria(Cat.class).add( Restrictions.in( "name", new String[] { "Fritz", "Izi", "Pk" } ) ).add( Restrictions.disjunction()

    .add( Restrictions.isNull("age") )

    .add( Restrictions.eq("age", new Integer(0) ) )

    .add( Restrictions.eq("age", new Integer(1) ) )

    .add( Restrictions.eq("age", new Integer(2) ) )

    ) ).list();

    3. 结果集排序

    使用org.hibernate.criterion.Order来为查询结果排序。

    List cats = sess.createCriteria(Cat.class).add( Restrictions.like("name", "F%")

    .addOrder( Order.asc("name") ).addOrder( Order.desc("age") ).setMaxResults(50)

    .list();

    List cats = sess.createCriteria(Cat.class).add( Property.forName("name").like("F%") ).addOrder( Property.forName("name").asc() ).addOrder( Property.forName("age").desc() ).setMaxResults(50).list();

    4. 关联

    使用createCriteria()很容易的在互相关联的实体间建立约束。

    List cats = sess.createCriteria(Cat.class) .add( Restrictions.like("name", "F%")

    .createCriteria("kittens").add( Restrictions.like("name", "F%").list();

    5. 查询示例

    org.hibernate.criterion.Example类允许通过一个给定实例来构建一个条件查询。

    Cat cat = new Cat();

    cat.setSex('F');

    cat.setColor(Color.BLACK);

    List results = session.createCriteria(Cat.class).add( Example.create(cat) ) .list();

    6. 投影(Projections)、聚合(aggregation)和分组(grouping)

    org.hibernate.criterion.Projections是 Projection 的实例工厂。一般通过调用

    setProjection()应用投影到一个查询。

    List results = session.createCriteria(Cat.class).setProjection( Projections.rowCount() ).add( Restrictions.eq("color", Color.BLACK) ).list();

    List results = session.createCriteria(Cat.class).setProjection( Projections.projectionList()

    .add( Projections.rowCount() )

    .add( Projections.avg("weight") )

    .add( Projections.max("weight") )

    .add( Projections.groupProperty("color") )).list();

       在一个条件查询中没有必要显式的使用 "group by" 。某些投影类型就是被定义为分组投影,而这些投影类型也出现在SQL的group by子句中。 可以选择把一个别名指派给一个投影,这样可以使投影值被约束或排序所引用。

    下面是两种不同的实现方式:

    List results = session.createCriteria(Cat.class).setProjection(

    Projections.alias( Projections.groupProperty("color"), "colr" ) ).addOrder( Order.asc("colr") ).list();

    List results = session.createCriteria(Cat.class).setProjection(

    Projections.groupProperty("color").as("colr") ).addOrder( Order.asc("colr") ).list();

    alias()和as()方法简便的将一个投影实例包装到另外一个 别名的Projection实例中。简而言之,当你添加一个投影到一个投影列表中时你可以为它指定一个别名:

    List results = session.createCriteria(Cat.class)

    .setProjection( Projections.projectionList()

    .add( Projections.rowCount(), "catCountByColor" )

    .add( Projections.avg("weight"), "avgWeight" )

    .add( Projections.max("weight"), "maxWeight" )

    .add( Projections.groupProperty("color"), "color" )

    )

    .addOrder( Order.desc("catCountByColor") )

    .addOrder( Order.desc("avgWeight") )

    .list();

    List results = session.createCriteria(Domestic.class, "cat")

    .createAlias("kittens", "kit")

    .setProjection( Projections.projectionList()

    .add( Projections.property("cat.name"), "catName" )

    .add( Projections.property("kit.name"), "kitName" )

    )

    .addOrder( Order.asc("catName") )

    .addOrder( Order.asc("kitName") )

    .list();

    原文链接:https://blog.csdn.net/wenbing2610/article/details/84477441

    展开全文
  • 所有与json相关东西都必须在你WebService层中.您服务层必须管理Web服务和dao层之间事务和通信.首先,我们来谈谈您Web服务层.您JSON对象可能来自Restful Web服务.由于几乎所有框架都支持json编组/解组,...

    首先,您必须考虑以分层方式重新构建应用程序.您至少需要3层,DAO,服务和WebService.

    有关数据库和JPA的所有内容都必须位于DAO层中.所有与json相关的东西都必须在你的WebService层中.您的服务层必须管理Web服务和dao层之间的事务和通信.

    首先,我们来谈谈您的Web服务层.您的JSON对象可能来自Restful Web服务.由于几乎所有框架都支持json编组/解组,因此手动解析数据传输对象是不明智的.我的意思是,你可能更喜欢声明一个FieldDto类并传递它的实例而不是JSONObject.这是FieldDto的一个例子.这是一个POJO.

    public class FieldDto {

    private String prodId;

    private String prodName;

    // Getters & Setters etc.

    }

    您可以使用GSON或Jackson轻松地对json进行编组/解组.可能你的框架默认使用其中一个来处理json转换.

    下一层是服务层.在服务层中,您可以管理事务并将DTO对象转换为DAO层可以轻松理解的对象.在这种情况下,您的服务层将fieldDto.getProdId()和fielDto.getProdName()传递给DAO层.

    你的最后一层是DAO层.首先让我们改变您的方法签名.

    public List getProducts(String prodId, String prodName) {

    CriteriaBuilder criteriaBuilder = getEntityManager().getCriteriaBuilder();

    CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Product.class);

    Root root = criteriaQuery.from(Product.class);

    List p = new ArrayList ();

    if(prodId != null){

    p.add(criteriaBuilder.like(root.get(Product_.prodId),prodId));

    }

    if(prodName != null){

    p.add(criteriaBuilder.like(root.get(Product_.prodName), prodName));

    }

    if(!p.isEmpty()){

    Predicate[] pr = new Predicate[p.size()];

    p.toArray(pr);

    criteriaQuery.where(pr);

    }

    return getEntityManager().createQuery(criteriaQuery).getResultList();

    }

    这不是它.此代码仍需改进.在我的一个项目中,我创建了一个流畅的api来管理所有的样板部件.当你开始编写其他DAO类时,你会发现一些代码块一遍又一遍地重复.

    这是一个流畅的api的例子.您可能想要构建它的版本.

    import javax.persistence.EntityManager;

    import javax.persistence.LockModeType;

    import javax.persistence.PersistenceException;

    import javax.persistence.TypedQuery;

    import javax.persistence.criteria.*;

    import javax.persistence.metamodel.Attribute;

    import javax.persistence.metamodel.CollectionAttribute;

    import javax.persistence.metamodel.PluralAttribute;

    import javax.persistence.metamodel.SingularAttribute;

    import java.util.ArrayList;

    import java.util.Collection;

    import java.util.List;

    import java.util.Vector;

    public final class SimpleSelectBuilder {

    private final EntityManager entityManager;

    private final CriteriaBuilder criteriaBuilder;

    private final CriteriaQuery criteriaQuery;

    private final Root root;

    private final Collection predicates;

    private Integer first = null;

    private Integer max = null;

    private LockModeType lockModeType = null;

    public SimpleSelectBuilder(final EntityManager entityManager, final Class entityClazz) {

    this.entityManager = entityManager;

    this.criteriaBuilder = entityManager.getCriteriaBuilder();

    this.criteriaQuery = this.criteriaBuilder.createQuery(entityClazz);

    this.root = criteriaQuery.from(entityClazz);

    this.predicates = new Vector<>();

    }

    public SimpleSelectBuilder and(final Attribute attribute, final Object value) {

    final Expression expression = this.getExpression(attribute, root);

    this.predicates.add(criteriaBuilder.equal(expression, value));

    return this;

    }

    public SimpleSelectBuilder andNotIn(final Attribute attribute, final Collection values) {

    final Expression expression = this.getExpression(attribute, root);

    this.predicates.add(criteriaBuilder.not(expression.in(values)));

    return this;

    }

    public SimpleSelectBuilder andIn(final Attribute attribute, final Collection values) {

    final Expression expression = this.getExpression(attribute, root);

    this.predicates.add(expression.in(values));

    return this;

    }

    public SimpleSelectBuilder andContains(final Attribute attribute, final Object value) {

    final Expression expression = this.getExpression(attribute, root);

    this.predicates.add(criteriaBuilder.isMember(value, expression));

    return this;

    }

    public SimpleSelectBuilder orderByAsc(final Attribute attribute) {

    final List orders = new ArrayList<>();

    if (this.criteriaQuery.getOrderList() != null) {

    orders.addAll(this.criteriaQuery.getOrderList());

    }

    orders.add(criteriaBuilder.asc(this.getExpression(attribute, root)));

    this.criteriaQuery.orderBy(orders.toArray(new Order[orders.size()]));

    return this;

    }

    public SimpleSelectBuilder orderByDesc(final Attribute attribute) {

    List orders = this.criteriaQuery.getOrderList();

    if (orders == null) {

    orders = new ArrayList<>();

    }

    orders.add(criteriaBuilder.desc(this.getExpression(attribute, root)));

    this.criteriaQuery.orderBy(orders.toArray(new Order[orders.size()]));

    return this;

    }

    public SimpleSelectBuilder setFirst(Integer first) {

    this.first = first;

    return this;

    }

    public SimpleSelectBuilder setMax(Integer max) {

    this.max = max;

    return this;

    }

    public SimpleSelectBuilder setLockModeType(LockModeType lockModeType) {

    this.lockModeType = lockModeType;

    return this;

    }

    public List getResultList() {

    final TypedQuery query = this.prepareQuery();

    if (lockModeType != null) {

    query.setLockMode(lockModeType);

    }

    if (first != null) {

    query.setFirstResult(first);

    }

    if (max != null) {

    query.setMaxResults(max);

    }

    return query.getResultList();

    }

    public List getCacheableResultList() {

    final TypedQuery query = this.prepareQuery();

    if (lockModeType != null) {

    query.setLockMode(lockModeType);

    }

    if (first != null) {

    query.setFirstResult(first);

    }

    if (max != null) {

    query.setMaxResults(max);

    }

    query.setHint("org.hibernate.cacheable", true);

    query.setHint("org.hibernate.cacheMode", "NORMAL");

    return query.getResultList();

    }

    public E getSingleResult() {

    final TypedQuery query = this.prepareQuery();

    if (lockModeType != null) {

    query.setLockMode(lockModeType);

    }

    return query.getSingleResult();

    }

    public E getCacheableSingleResult() {

    final TypedQuery query = this.prepareQuery();

    if (lockModeType != null) {

    query.setLockMode(lockModeType);

    }

    query.setHint("org.hibernate.cacheable", true);

    query.setHint("org.hibernate.cacheMode", "NORMAL");

    return query.getSingleResult();

    }

    private TypedQuery prepareQuery() {

    this.criteriaQuery.where(this.predicates.toArray(new Predicate[this.predicates.size()]));

    return this.entityManager.createQuery(criteriaQuery);

    }

    private Expression getExpression(final Attribute attribute, final From from) {

    if (attribute instanceof SingularAttribute) {

    SingularAttribute singularAttribute = (SingularAttribute) attribute;

    return from.get(singularAttribute);

    } else if (attribute instanceof PluralAttribute) {

    PluralAttribute pluralAttribute = (PluralAttribute) attribute;

    return from.get(pluralAttribute);

    } else {

    throw new PersistenceException("Attribute type of '" + attribute

    + "' must be one of [SingularAttribute, PluralAttribute].");

    }

    }

    private Join getJoinExpression(final Attribute attribute, final From from) {

    if (attribute instanceof SingularAttribute) {

    final SingularAttribute singularAttribute = (SingularAttribute) attribute;

    return from.join(singularAttribute);

    } else if (attribute instanceof CollectionAttribute) {

    final CollectionAttribute collectionAttribute = (CollectionAttribute) attribute;

    return from.join(collectionAttribute);

    } else {

    throw new PersistenceException("Attribute type of '" + attribute

    + "' must be one of [SingularAttribute, PluralAttribute].");

    }

    }

    public SimpleSelectBuilder joinAnd(final Attribute attribute, final Object value, final Attribute... joinOn) {

    Join tableJoin = null;

    for (final Attribute join : joinOn) {

    if (tableJoin == null) {

    tableJoin = this.getJoinExpression(join, root);

    } else {

    tableJoin = this.getJoinExpression(join, tableJoin);

    }

    }

    if (tableJoin == null) {

    throw new PersistenceException("SelectBuilder cannot construct your join statement");

    }

    final Expression expression = this.getExpression(attribute, tableJoin);

    this.predicates.add(criteriaBuilder.equal(expression, value));

    return this;

    }

    }

    如果你使用这个.比你的方法成为这个.

    public List getProducts(String prodId, String prodName) {

    // TODO add like statement to SimpleSelectBuilder

    return new SimpleSelectBuilder(this.getEntityManager(), Product.class)

    .and(Product_.prodId, prodId))

    .and(Product_.prodName, prodName))

    .getResultList();

    }

    如果您编写自己的SimpleSelectBuilder来处理样板代码块并提高可重用性,那将会更好.例如,您需要在上面的代码中添加like语句.

    管理所有层,事务,连接池等将花费您的时间.相反,您可能需要考虑使用中间件来管理所有这些.在我的项目中,我更喜欢Spring.

    展开全文
  • Criteria对SQL进行封装,让开发人员可以用物件方式来对资料库进行操作,例如下面查询User表格中所有资料:Criteria criteria = session.createCriteria(User.class);// 查询user所有栏位List users = criteria...
  • Criterion criterion = null;Criteria cr = session.createCriteria(Users.class);for (int i=0;iif("usersLoginid".equals(name[i])) {criterion = or(criterion, Restrictions.like ("usersLoginid","%cus%"));} ....
  • 我们讲一下Criteria查询,这个对于不是太熟悉SQL语句我们这些程序员来说是很容易上手。废话不多说,看一下例子:实体类如下:public class User implements Serializable{private static final long ...
  • 最近在bai项目中使用 Spring 和 Hibernate 进行开发,有感于du Criteria 比较好用,在查询方法设计上可zhi以灵活根据 Criteria 特点来方便地dao进行查询条件组装。现在对 HibernateCriteria 用法进行总结...
  • java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterioncom.yourcompany.struts.action.AddAdminAction.execute(AddAdminAction.java:62)理由是很简单,因为工程布署时候没有加入hibernate3jar包...
  • Hibernate的条件查询主要通过Criteria类、Criterion、Restrictions来完成,作用是:...下面例子是通过criterion.Restrictions进行条件查询,取得ajava的ID为1,3,5,7的用户名。 , [code="java"]pac...
  • Criterion查询例子

    2011-03-21 16:30:32
    java代码: public List findResourceBySearch( ResourceContent resourceContent, int off, int max, Object... date) { Session session = this.getSession(true); Crit...
  • java利用反射获取类属性及类型。importjava.lang.reflect.Field;importjava.math.BigDecimal;importjava.util.Map;importorg.apache.commons.lang.StringUtils;importorg.hibernate.Criteria;importorg.hibernate....
  • JAVA的dateutils处理类

    千次阅读 2011-01-04 17:21:00
    import java.text.ParseException; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar;...import org.hibernate.criterion.Criterion; import org.hiberna
  • SSH整合BaseDaoImpl.java

    2018-04-10 11:54:01
    import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.List;...import org.hibernate.criterion.DetachedCriteria; import org.hibernate.c
  • 一、什么是example类mybatis-generator会为每个字段产生如上的Criterion,如果表的字段比较多,产生的Example类会十分庞大。理论上通过example类可以构造你想到的任何筛选条件。在mybatis-generator中加以配置,配置...
  • 一、什么是example类mybatis-generator会为每个字段产生如上的Criterion,如果表的字段比较多,产生的Example类会十分庞大。理论上通过example类可以构造你想到的任何筛选条件。在mybatis-generator中加以配置,配置...
  • 它只能部分工作:Criterion subQ1 = Subqueries.propertyIn("id",DetachedCriteria.forClass(OpB.class).add(Restrictions.eq("account", account)).createAlias("account", "_account").add(Restrictions.eq("_acc....
  • org.hibernate.criterion.Criterion是Hibernate提供一个面向对象查询条件接口.一个单独查询就是Criterion接口一个实例,用于限制Criteria对象查询,在Hibernate中Criterion对象创建通常是通过...
  • 12.2.缩小结果集范围一个查询条件(Criterion)是...类net.sf.hibernate.expression.Expression定义了获得一些内置的Criterion类型。List cats = sess.createCriteria(Cat.class).add( Expression.like...
  • 投影(Projections)、聚合(aggregation)和分组(grouping)org.hibernate.criterion.Projections是 Projection 实例工厂。我们通过调用 setProjection()应用投影到一个查询。List results = session.createCriteria...
  • 一、什么是example类mybatis-generator会为每个字段产生Criterion,为底层mapper.xml创建动态sql。如果表字段比较多,产生example类会十分庞大。理论上通过example类可以构造你想到任何筛选条件。在mybatis-...
  • JavaLobby 关于Java界面调查结果

    千次阅读 2004-11-29 23:25:00
    If my personal preference is the sole criterion, then my next client-side Java application will use:(Comments...)Current vote count: 366
  • import org.hibernate.criterion.Restrictions; //导入方法依赖package包/类/*** 按属性条件参数创建Criterion,辅助函数.** @param propertyName* String* @param propertyValue* Object* @param matchType* ...
  • Hibernate分页两种实现方法本文实例讲述了Hibernate分页... criteria分页public Page getPage(int currentPage,int pageSize,Criterion...crts){Criteria c=session.createCriteria(House.class);List list=nul...
  • 今天使用Example查询,结果发现设置条件无效. 查询代码: Java代码 /*** * *@paramobj *@paramincludeZeros *@return */ privateCriteriagetCriteria(Object...
  • 几个JavaPortal概述

    2008-05-22 17:32:00
    Standards support is an important criterion for most corporate development projects. In the area of enterprise portal servers, that means a J2EE-compliant engine that supports standards such as portle
  • 本文实例讲述了Hibernate分页两种实现... criteria分页public Page getPage(int currentPage,int pageSize,Criterion...crts){Criteria c=session.createCriteria(House.class);List list=null;for (int i = 0; ...
  • import weka.core.... //导入方法依赖package包/类/*** Test using Fayyad and Irani's MDL criterion.** @param priorCounts* @param bestCounts* @param numInstances* @param numCutPoints* @return true...
  • find(final Criterion... criterions) { //这个方法可以find()不带参数,也可以带一个叁数 return createCriteria(criterions).list(); }   public &lt;X&gt; List&lt;X&gt; find(final ...
  • package ... import com.jade.framework.base.criterion.Criteria; import com.jade.framework.base.util.PagingList; import com.jade.basung.bss.BaseException; /** * dao层公共接

空空如也

空空如也

1 2 3 4 5 6
收藏数 104
精华内容 41
关键字:

java的criterion

java 订阅