Package com.liferay.portal.kernel.dao.orm

Examples of com.liferay.portal.kernel.dao.orm.DynamicQuery


            throw new Exception("Checking failed!!!");
        }
    }

    public static User findUser(String email) throws SystemException {
        DynamicQuery dqUser = DynamicQueryFactoryUtil.forClass(User.class)
                .add(PropertyFactoryUtil.forName("emailAddress").like("%" + email + "%"));
        return (User) UserLocalServiceUtil.dynamicQuery(dqUser).get(0);
    }
View Full Code Here


    warrant.setModifiedDate(new Date());
    return WarrantUtil.update(warrant, true);
  }
 
  public List<Warrant> findWarrants(int start, int count) throws SystemException {
    DynamicQuery dynamicQuery = createDynamicQuery()
        .add(RestrictionsFactoryUtil.eq("status", WarrantStateType.CREATED.name()));
    dynamicQuery.addOrder(OrderFactoryUtil.desc("createDate"));
    dynamicQuery.setLimit(start, start + count);
    return dynamicQuery(dynamicQuery);
  }
View Full Code Here

    dynamicQuery.setLimit(start, start + count);
    return dynamicQuery(dynamicQuery);
  }
 
  public void cleanUpWarrantsDeletedBefore(Date before) throws NoSuchWarrantException, SystemException {
    DynamicQuery dynamicQuery = createDynamicQuery()
        .add(RestrictionsFactoryUtil.eq("status", WarrantStateType.DELETED.name()))
        .add(RestrictionsFactoryUtil.le("modifiedDate", before));
    List<Warrant> warrants = dynamicQuery(dynamicQuery);
    for (Warrant warrant : warrants) {
      WarrantUtil.remove(warrant.getId());
View Full Code Here

    // TODO Auto-generated method stub
    return null;
  }
 
  public List<Warrant> findWarrantsByCreateDate(Date from, Date to) throws SystemException {
    DynamicQuery dynamicQuery = createDynamicQuery()
        .add(RestrictionsFactoryUtil.eq("status", WarrantStateType.CREATED.name()))
        .add(RestrictionsFactoryUtil.eq("expirationWarningSent", false));
    if (from != null) {
      dynamicQuery = dynamicQuery.add(RestrictionsFactoryUtil.gt("createDate", from));
    }
    if (to != null) {
      dynamicQuery = dynamicQuery.add(RestrictionsFactoryUtil.le("createDate", to));
    }
    return dynamicQuery(dynamicQuery);
  }
View Full Code Here

   
    Session session = null;
    try {
      session = openSession();
     
      DynamicQuery dq = DynamicQueryFactoryUtil.forClass(Event.class)
          .add(RestrictionsFactoryUtil.eq("userId", userId));
     
      List<Event> events =  (List<Event>) EventLocalServiceUtil.dynamicQuery(dq);

      return events;
View Full Code Here

   
    Session session = null;
    try {
      session = openSession();
     
      DynamicQuery locationQuery = DynamicQueryFactoryUtil.forClass(Location.class)
          .add(RestrictionsFactoryUtil.eq("name", locationName))
          .setProjection(ProjectionFactoryUtil.property("locationId"));
     
      Order order = OrderFactoryUtil.desc("modifiedDate");
     
      DynamicQuery eventQuery = DynamicQueryFactoryUtil.forClass(Event.class)
          .add(RestrictionsFactoryUtil.eq("name", eventName))
          .add(RestrictionsFactoryUtil.eq("description", eventDescription))
          .add(PropertyFactoryUtil.forName("locationId").in(locationQuery))
          .addOrder(order);
     
View Full Code Here

TOP

Related Classes of com.liferay.portal.kernel.dao.orm.DynamicQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.