Package org.hibernate

Examples of org.hibernate.Query.executeUpdate()


            hql = "UPDATE OrderNumber SET lastOrderNumber = :newLastOrderNumber WHERE lastOrderNumber = :previousLastOrderNumber";
            query = session.createQuery(hql);
            query.setInteger("newLastOrderNumber", newLastOrderNumber);
            query.setInteger("previousLastOrderNumber", previousLastOrderNumber);
            int rowCount = query.executeUpdate();

            if (rowCount == 0) {
                em.getTransaction().rollback();
                mergedOrSavedOrderCustomer = createNewOrderWithRightOrderNumber(orderCustomer);
            }
View Full Code Here


      while (metas.hasNext()) {
          Object removedMeta = metas.next();
          if (removedMeta instanceof ContentFileMeta) {
            Query query = _parent.getSession().createQuery("delete ContentFilePart cfp where cfp.meta = :meta");
            query.setEntity("meta", removedMeta);
            query.executeUpdate();
          } else if (removedMeta instanceof ContainerFileMeta) {
            Query query = _parent.getSession().createQuery("delete ContainerFilePart cfp where cfp.meta = :meta");
            query.setEntity("meta", removedMeta);
            query.executeUpdate();
          }
View Full Code Here

            query.setEntity("meta", removedMeta);
            query.executeUpdate();
          } else if (removedMeta instanceof ContainerFileMeta) {
            Query query = _parent.getSession().createQuery("delete ContainerFilePart cfp where cfp.meta = :meta");
            query.setEntity("meta", removedMeta);
            query.executeUpdate();
          }
        }
    }

    /**
 
View Full Code Here

       
        Query query = getSession().createQuery(HQLQUERY_UPDATE_RELATIONS);
        query.setParameter("target", content);
        query.setParameter("structentry", content.getStructentry().getKey());
        query.setParameter("language", content.getLanguage().getName());
        query.executeUpdate();
    }



    public WGDocumentCore getStructEntryByName(String strName) throws WGAPIException {
View Full Code Here

            hql.append(" AND user is not null ");
   
        Query query = HibernateContext.getSession().createQuery(hql.toString());
        query.setString("type", type.toString());
       
        query.executeUpdate();
    }
   
    public ListConfigurationVO getDefaultListConfiguration(ListConfigurationVO.Type type, UserVO user) {
        ListConfigurationVO vo = null;
View Full Code Here

    }

    public void deleteAll() {
        Session sess = sessionFactory.openSession();
        Query query = sess.createQuery( "DELETE FROM Vehicle v" );
        query.executeUpdate();
    }

    public Vehicle add( Vehicle v ) {
        v.setId( nextId++ );
        Session sess = sessionFactory.openSession();
View Full Code Here

    @Override
    public void delete(Long id) {
        Query query = getSession().createQuery("delete Attachment where id = :attachmentId");
        query.setLong("attachmentId", id);
        query.executeUpdate();
    }

    @Override
    public void delete(Attachment attachment) {
        getSession().delete(attachment);
View Full Code Here

 
  public void delete(int id
  {
    Query query;
    query = sessionFactory.getCurrentSession().createQuery("delete from eDish where id = " + id);
    query.executeUpdate();
  }

  public void DeleteAll() 
  {
    Query query;
View Full Code Here

  public void DeleteAll() 
  {
    Query query;
    query = sessionFactory.getCurrentSession().createQuery("delete from eDish");
    query.executeUpdate();
  }

  @SuppressWarnings("unchecked")
  public eDish Read(eDish dish
  {
View Full Code Here

 
  public void Delete(int id
  {
    Query query;
    query = sessionFactory.getCurrentSession().createQuery("delete from eOrder where id = " + id);
    query.executeUpdate();
  }

  public void DeleteAll() 
  {
    Query query;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.