public void desc() { synchronized (m_orders) { if (m_orders.isEmpty()) { LOG.debug("desc() called, but no orderBy has been specified."); } else if (m_lastAttribute == null) { LOG.debug("desc() called on an attribute that can't be changed."); } else { for (final Order o : m_orders) { if (o.getAttribute().equals(m_lastAttribute)) { m_orders.remove(o); m_orders.add(Order.desc(m_lastAttribute)); break; } } } } }
public void asc() { synchronized (m_orders) { if (m_orders.isEmpty()) { LOG.debug("asc() called, but no orderBy has been specified."); } else if (m_lastAttribute == null) { LOG.debug("asc() called on an attribute that can't be changed."); } else { for (final Order o : m_orders) { if (o.getAttribute().equals(m_lastAttribute)) { m_orders.remove(o); m_orders.add(Order.asc(m_lastAttribute)); break; } } } } }
public static Order desc(final String attribute) { return new Order(attribute, false); }
@Override public void sort(Object[] propertyId, boolean[] ascending) { List<SortEntry> newSortEntries = createSortEntries(propertyId, ascending); if (!m_sortEntries.equals(newSortEntries)) { m_sortEntries.clear(); m_sortEntries.addAll(newSortEntries); m_orders.clear(); for(int i = 0; i < propertyId.length; i++) { final String beanProperty = (String)propertyId[i]; String hibernateProperty = m_beanToHibernatePropertyMapping.get(beanProperty); if (hibernateProperty == null) hibernateProperty = beanProperty; if (ascending[i]) { m_orders.add(Order.asc(hibernateProperty)); } else { m_orders.add(Order.desc(hibernateProperty)); } } cache.reload(page); } }
/** * <p>getAll</p> * * @return a {@link java.util.List} object. */ @Override public List<ReportCatalogEntry> getAll() { final Criteria onmsCrit = new Criteria(ReportCatalogEntry.class); onmsCrit.setOrders(Arrays.asList(new Order[] { Order.desc("date") })); return m_reportCatalogDao.findMatching(onmsCrit); }
ordersService.add(Order.asc("node.label")); ordersService.add(Order.asc("node.id")); ordersService.add(Order.asc("ipInterface.ipAddress")); ordersService.add(Order.asc("serviceType.name")); serviceCriteria.setOrders(ordersService); ordersOutage.add(Order.asc("monitoredService")); ordersOutage.add(Order.asc("ifLostService")); outageCriteria.setOrders(ordersOutage);
/** * Append an order object to the end of the order list. * * @param order * the order object to append * @return whether it was added (true if added, false if already * exists/ignored) */ boolean append(final Order order) { if (m_orders.add(order)) { m_lastAttribute = order.getAttribute(); return true; } else { m_lastAttribute = null; return false; } }
@Override public void visitOrder(final Order order) { final HibernateOrderVisitor visitor = new HibernateOrderVisitor(); order.visit(visitor); // we hold onto these later because they need to be applied after // distinct projection m_orders.add(visitor.getOrder()); }
@Override public void sort(Object[] propertyId, boolean[] ascending) { List<SortEntry> newSortEntries = createSortEntries(propertyId, ascending); if (!m_sortEntries.equals(newSortEntries)) { m_sortEntries.clear(); m_sortEntries.addAll(newSortEntries); m_orders.clear(); for(int i = 0; i < propertyId.length; i++) { final String beanProperty = (String)propertyId[i]; String hibernateProperty = m_beanToHibernatePropertyMapping.get(beanProperty); if (hibernateProperty == null) hibernateProperty = beanProperty; if (ascending[i]) { m_orders.add(Order.asc(hibernateProperty)); } else { m_orders.add(Order.desc(hibernateProperty)); } } cache.reload(page); } }
/** * <p>getAll</p> * * @return a {@link java.util.List} object. */ @Override public List<ReportCatalogEntry> getAll() { final Criteria onmsCrit = new Criteria(ReportCatalogEntry.class); onmsCrit.setOrders(Arrays.asList(new Order[] { Order.desc("date") })); return m_reportCatalogDao.findMatching(onmsCrit); }
ordersService.add(Order.asc("node.label")); ordersService.add(Order.asc("node.id")); ordersService.add(Order.asc("ipInterface.ipAddress")); ordersService.add(Order.asc("serviceType.name")); serviceCriteria.setOrders(ordersService); ordersOutage.add(Order.asc("monitoredService")); ordersOutage.add(Order.asc("ifLostService")); outageCriteria.setOrders(ordersOutage);
/** * Append an order object to the end of the order list. * * @param order * the order object to append * @return whether it was added (true if added, false if already * exists/ignored) */ boolean append(final Order order) { if (m_orders.add(order)) { m_lastAttribute = order.getAttribute(); return true; } else { m_lastAttribute = null; return false; } }
@Override public void sort(Object[] propertyId, boolean[] ascending) { List<SortEntry> newSortEntries = createSortEntries(propertyId, ascending); if (!m_sortEntries.equals(newSortEntries)) { m_sortEntries.clear(); m_sortEntries.addAll(newSortEntries); m_orders.clear(); for(int i = 0; i < propertyId.length; i++) { final String beanProperty = (String)propertyId[i]; String hibernateProperty = m_beanToHibernatePropertyMapping.get(beanProperty); if (hibernateProperty == null) hibernateProperty = beanProperty; if (ascending[i]) { m_orders.add(Order.asc(hibernateProperty)); } else { m_orders.add(Order.desc(hibernateProperty)); } } cache.reload(page); } }
public void asc() { synchronized (m_orders) { if (m_orders.isEmpty()) { LOG.debug("asc() called, but no orderBy has been specified."); } else if (m_lastAttribute == null) { LOG.debug("asc() called on an attribute that can't be changed."); } else { for (final Order o : m_orders) { if (o.getAttribute().equals(m_lastAttribute)) { m_orders.remove(o); m_orders.add(Order.asc(m_lastAttribute)); break; } } } } }
.addRestriction(new LikeRestriction("entPhysicalName", likeQuery)) .setOrders(Arrays.asList(new Order[] { Order.desc("id") })); List<OnmsHwEntity> hwEntities = hwEntityDao.findMatching(criteria);
public void desc() { synchronized (m_orders) { if (m_orders.isEmpty()) { LOG.debug("desc() called, but no orderBy has been specified."); } else if (m_lastAttribute == null) { LOG.debug("desc() called on an attribute that can't be changed."); } else { for (final Order o : m_orders) { if (o.getAttribute().equals(m_lastAttribute)) { m_orders.remove(o); m_orders.add(Order.desc(m_lastAttribute)); break; } } } } }
public static Order asc(final String attribute) { return new Order(attribute, true); }
public void visit(final OrderVisitor visitor) { visitor.visitAttribute(getAttribute()); visitor.visitAscending(asc()); }
.addRestriction(new LikeRestriction("entPhysicalName", likeQuery)) .setOrders(Arrays.asList(new Order[] { Order.desc("id") })); List<OnmsHwEntity> hwEntities = hwEntityDao.findMatching(criteria);
public static Order desc(final String attribute) { return new Order(attribute, false); }