Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTemplateTests


  @SuppressWarnings("unchecked")
  public List<PackableListItem> findByOrderNrAndProductAreaGroup(
      final String orderNr, final ProductAreaGroup productAreaGroup) {
    return (List<PackableListItem>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(Session session)
              throws HibernateException {
            Criteria criteria=   session.createCriteria(GulvsponPackageV.class)
                .add(Restrictions.eq("orderNr", orderNr));
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public final List<Integer> getDocumentIdByPeriode(final Periode periode) {
        return (List<Integer>) getHibernateTemplate().execute(
                new HibernateCallback() {

                    public Object doInHibernate(final Session session) {
                        Integer startDate = Util.convertDateToInt(periode
                                .getStartDate());
                        Integer endDate = Util.convertDateToInt(periode
View Full Code Here

    public UdsalesmallDAOHibernate() {
        super(Udsalesmall.class);
    }

  public Udsalesmall findByOrderNr(final String orderNr) {
    return (Udsalesmall)getHibernateTemplate().execute(new HibernateCallback() {
     
      public Object doInHibernate(final Session session){
        String sql="select udsalesmall " +
            "     from Udsalesmall udsalesmall,Sale sale" +
            "     where udsalesmall.udsalesmallId=sale.userdefId and " +
View Full Code Here

  @SuppressWarnings("unchecked")
  public final List<Budget> findByYearAndWeek(final Integer year,
      final Integer week, final Integer notId,
      final ProductArea productArea, final BudgetType budgetType) {
    return (List<Budget>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            Criteria crit = session.createCriteria(Budget.class)
                .add(
                    Restrictions.eq("productArea",
View Full Code Here

   *      java.lang.Integer, no.ugland.utransprod.model.ProductArea)
   */
  public final Budget findByYearAndWeek(final Integer year,
      final Integer week, final ProductArea productArea,
      final BudgetType budgetType) {
    return (Budget) getHibernateTemplate().execute(new HibernateCallback() {

      @SuppressWarnings("unchecked")
      public Object doInHibernate(final Session session) {
        List<Budget> list = session.createCriteria(Budget.class).add(
            Restrictions.eq("productArea", productArea)).add(
View Full Code Here

        AnnotationSessionFactoryBean sessionFactory = new AnnotationSessionFactoryBean();
        sessionFactory.setDataSource(dataSource);
        sessionFactory.setAnnotatedClasses(new Class[] {PhotoSpot.class});
        sessionFactory.afterPropertiesSet();

        repo.hibernate = new HibernateTemplate(sessionFactory.getObject());
    }
View Full Code Here

  public Hibernate3UserDao() {
    super();
  }

  public void setSessionFactory(SessionFactory sessionFactory) {
    this.hibernateTemplate = new HibernateTemplate(sessionFactory, true);
  }
View Full Code Here

      if (hibernateTemplate != null)
        logger.debug("hibernateTemplate present - jBPM persistence service will be managed by Spring");
      else {
        if (dummy.getSessionFactory() != null) {
          logger.debug("creating hibernateTemplate based on jBPM SessionFactory");
          hibernateTemplate = new HibernateTemplate(dummy.getSessionFactory());
        }
        else

          logger.debug("hibernateTemplate missing - jBPM will handle its own persistence");
      }
View Full Code Here

   */
  public void afterPropertiesSet() {
    if (jbpmSessionFactory == null)
      throw new IllegalArgumentException("jbpmSessionFactory must be set");
    // init the hbTemplate that will be used to prepare and handle the HB Session
    hibernateTemplate = new HibernateTemplate(jbpmSessionFactory.getSessionFactory());
    hibernateTemplate.setAllowCreate(allowCreate);
  }
View Full Code Here

    public void setUp() throws Exception {
        dataSource = new DriverManagerDataSource("jdbc:h2:mem:hibernate;DB_CLOSE_DELAY=-1", "sa", "sa");

        System.setProperty("hibernate.dialect", H2Dialect.class.getName());
        System.setProperty("hibernate.hbm2ddl.auto", "create-drop");
        AnnotationSessionFactoryBean sessionFactory = new AnnotationSessionFactoryBean();
        sessionFactory.setDataSource(dataSource);
        sessionFactory.setAnnotatedClasses(new Class[] {PhotoSpot.class});
        sessionFactory.afterPropertiesSet();

        repo.hibernate = new HibernateTemplate(sessionFactory.getObject());
    }
View Full Code Here

TOP

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

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.