Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.SessionHolder


   *      java.lang.String)
   */
  public NokkelDriftProsjekteringV aggreagateYearWeek(
      final YearWeek currentYearWeek, final String productArea) {
    return (NokkelDriftProsjekteringV) getHibernateTemplate().execute(
        new HibernateCallback() {

          @SuppressWarnings("unchecked")
          public Object doInHibernate(Session session)
              throws HibernateException {
            String query = "select sum(nokkelDriftProsjekteringV.orderCount),"
View Full Code Here


        super(OrdchgrLineV.class);
    }

    @SuppressWarnings("unchecked")
  public List<OrdchgrLineV> getLines(final Integer ordNo, final List<Integer> lnNos) {
        return (List<OrdchgrLineV>) getHibernateTemplate().execute(new HibernateCallback() {

            public Object doInHibernate(final Session session) {

                return session.createCriteria(OrdchgrLineV.class).add(Restrictions.eq("ordchgrLineVPK.ordNo", ordNo)).add(
                        Restrictions.in("ordchgrLineVPK.lnNo", lnNos)).list();
View Full Code Here

  @SuppressWarnings("unchecked")
  private List<DeviationSumJobFunctionV> getAllProductAreaGroup(final Integer year,
      final JobFunction deviationFunction, final ProductAreaGroup productAreaGroup) {
    return (List<DeviationSumJobFunctionV>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            String query="select new DeviationSumJobFunctionV(''," +
                "                                         deviationSumJobFunctionVPK.registrationYear," +
                "                                         deviationSumJobFunctionVPK.registrationWeek," +
View Full Code Here

  @SuppressWarnings("unchecked")
  private List<DeviationSumJobFunctionV> getPerProductAreaGroup(
      final Integer year, final JobFunction deviationFunction,
      final ProductAreaGroup productAreaGroup) {
    return (List<DeviationSumJobFunctionV>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            return session
                .createCriteria(DeviationSumJobFunctionV.class)
                .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

  @Before
  public void setUp() throws Exception
    System.out.println("====================start");
        session = SessionFactoryUtils.getSession(sessionFactory, true)
        session.setFlushMode(FlushMode.NEVER)
        TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session))
    }
View Full Code Here

  @Before
  public void setUp() throws Exception
    System.out.println("====================start");
        session = SessionFactoryUtils.getSession(sessionFactory, true)
        session.setFlushMode(FlushMode.NEVER)
        TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session))
    }
View Full Code Here

TOP

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

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.