Exemplo n.º 1
0
  public void updateFromDrop(
      Long resourceComponentId,
      Long resourceParentId,
      Long resourceComponentParentId,
      Double componentOrder) {

    Session session = SessionFactory.getInstance().openSession();
    Query query = session.getNamedQuery("updateFromDrop");
    query.setLong("resourceComponentId", resourceComponentId);
    if (resourceParentId == null) {
      query.setLong("resourceId", 0l);
    } else {
      query.setLong("resourceId", resourceParentId);
    }
    if (resourceComponentParentId == null) {
      query.setLong("parentResourceComponentId", 0l);
    } else {
      query.setLong("parentResourceComponentId", resourceComponentParentId);
    }
    query.setDouble("resourcesOrder", componentOrder);
    query.list();
    session.close();
  }
Exemplo n.º 2
0
 public List lookupResourceComponentByParentResourceComponent(Resources r) {
   Session session = SessionFactory.getInstance().openSession();
   List al = this.lookupResourceComponentByParentResource(r, session);
   session.close();
   return al;
 }