Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateCallback


  public void testHibernateIntegration() {
    hibernateTransactionTemplate.execute(new TransactionCallback() {
      public Object doInTransaction(TransactionStatus status) {
        // Testing access through HibernateTemplate
        Hotel hotel = (Hotel)getHibernateTemplate().execute(new HibernateCallback() {
          public Object doInHibernate(org.hibernate.Session session) throws HibernateException, SQLException {
            return getFirstHotel(session);
          }
        });
        hotel.setName(HIBERNATE_HOTEL_NAME);
View Full Code Here


    /**
     * Batch Update in HQL
     * http://www.hibernate.org/hib_docs/reference/en/html/batch.html#batch-direct
     */
    public void incrementSchoolPopularity(final School school) {
        getHibernateTemplate().execute(new HibernateCallback() {
            public Object doInHibernate(Session session)
                    throws HibernateException, SQLException {

                String hql = "update School set popularityCounter = popularityCounter + 1 where id = :id";
                int updated = session.createQuery(hql).setLong("id",
View Full Code Here

    try {
      // use the hibernateTemplate is present and if needed
      if (hibernateTemplate != null && hasPersistenceService) {

        // use hibernate template
        return hibernateTemplate.execute(new HibernateCallback() {
          /**
           * @see org.springframework.orm.hibernate3.HibernateCallback#doInHibernate(org.hibernate.Session)
           */
          public Object doInHibernate(Session session) throws HibernateException, SQLException {
            // inject the session in the context
View Full Code Here

    if (existingTransaction) {
      logger.debug("Found thread-bound Session for JbpmTemplate");
    }

    try {
      return hibernateTemplate.execute(new HibernateCallback() {
        /**
         * @see org.springframework.orm.hibernate3.HibernateCallback#doInHibernate(org.hibernate.Session)
         */
        public Object doInHibernate(Session session) throws HibernateException, SQLException {
          return callback.doInJbpm(jbpmSession);
View Full Code Here

    /**
     * @see no.ugland.utransprod.dao.SumOrderReadyVDAO#findByDate(java.lang.String)
     */
    public SumOrderReadyV findByDate(final String dateString) {
        return (SumOrderReadyV) getHibernateTemplate().execute(new HibernateCallback() {

            @SuppressWarnings("unchecked")
            public Object doInHibernate(Session session) throws HibernateException {
                List<SumOrderReadyV> list = session.createCriteria(SumOrderReadyV.class).add(
                        Restrictions.eq("sumOrderReadyVPK.orderReady", dateString)).list();
View Full Code Here

    /**
     * @see no.ugland.utransprod.dao.SumOrderReadyVDAO#findSumByWeek(java.lang.Integer,
     *      java.lang.Integer)
     */
    public SumOrderReadyV findSumByWeek(final Integer year, final Integer week) {
        return (SumOrderReadyV) getHibernateTemplate().execute(new HibernateCallback() {

            @SuppressWarnings("unchecked")
            public Object doInHibernate(Session session) throws HibernateException {
                List<SumOrderReadyV> list = session.createCriteria(SumOrderReadyV.class).add(
                        Restrictions.eq("orderReadyYear", year)).add(Restrictions.eq("orderReadyWeek", week))
View Full Code Here

     * @see no.ugland.utransprod.dao.SumOrderReadyVDAO#findByDateAndProductAreaGroupName(java.lang.String,
     *      java.lang.String)
     */
    public SumOrderReadyV findByDateAndProductAreaGroupName(final String dateString,
            final String productAreaGroupName) {
        return (SumOrderReadyV) getHibernateTemplate().execute(new HibernateCallback() {

            @SuppressWarnings("unchecked")
            public Object doInHibernate(Session session) throws HibernateException {
                List<SumOrderReadyV> list = session.createCriteria(SumOrderReadyV.class).add(
                        Restrictions.eq("sumOrderReadyVPK.orderReady", dateString)).add(
View Full Code Here

     * @see no.ugland.utransprod.dao.SumOrderReadyVDAO#findSumByWeekAndProductAreaGroupName(java.lang.Integer,
     *      java.lang.Integer, java.lang.String)
     */
    public SumOrderReadyV findSumByWeekAndProductAreaGroupName(final Integer year, final Integer week,
            final String productAreaGroupName) {
        return (SumOrderReadyV) getHibernateTemplate().execute(new HibernateCallback() {

            @SuppressWarnings("unchecked")
            public Object doInHibernate(Session session) throws HibernateException {
                List<SumOrderReadyV> list = session.createCriteria(SumOrderReadyV.class).add(
                        Restrictions.eq("orderReadyYear", year)).add(Restrictions.eq("orderReadyWeek", week))
View Full Code Here

  /**
   * @see no.ugland.utransprod.dao.ContactDAO#findAllTilAvrop(java.lang.Integer)
   */
  @SuppressWarnings("unchecked")
  public List<Contact> findAllTilAvrop(final Integer category) {
    return getHibernateTemplate().executeFind(new HibernateCallback() {

      public Object doInHibernate(Session session)
          throws HibernateException {
        return session.createCriteria(Contact.class).add(
            Restrictions.eq("categoryIdx", category)).list();
View Full Code Here

  /**
   * @see no.ugland.utransprod.dao.OrderStatusNotSentVDAO#findByParams(no.ugland.utransprod.util.excel.ExcelReportSetting)
   */
  @SuppressWarnings("unchecked")
  public List<StatusOrdersNotSent> findByParams(final ExcelReportSetting params) {
    return (List) getHibernateTemplate().execute(new HibernateCallback() {

      public Object doInHibernate(Session session)
          throws HibernateException {
        List<Object[]> list = getSumPacklistNotReady(params, session);
       
View Full Code Here

TOP

Related Classes of org.springframework.orm.hibernate3.HibernateCallback

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.