Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTemplateTests


     * @see no.ugland.utransprod.dao.ArticleTypeDAO#lazyLoad(no.ugland.utransprod.model.ArticleType,
     *      no.ugland.utransprod.service.enums.LazyLoadArticleTypeEnum[])
     */
    public void lazyLoad(final ArticleType articleType, final LazyLoadArticleTypeEnum[] enums) {
        if (articleType != null && articleType.getArticleTypeId() != null) {
            getHibernateTemplate().execute(new HibernateCallback() {

                public Object doInHibernate(Session session) throws HibernateException {
                    if (!session.contains(articleType)) {
                        session.load(articleType, articleType.getArticleTypeId());
                    }
View Full Code Here


    /**
     * @see no.ugland.utransprod.dao.ArticleTypeDAO#findAllConstructionTypeAttributes()
     */
    @SuppressWarnings("unchecked")
    public List<Attribute> findAllConstructionTypeAttributes() {
        return (List<Attribute>) getHibernateTemplate().execute(new HibernateCallback() {

            public Object doInHibernate(Session session) throws HibernateException {
                return session
                        .createQuery(
                                "select distinct constructionTypeAttribute.attribute from ConstructionTypeAttribute constructionTypeAttribute")
View Full Code Here

        });
    }


    public ArticleType findByProdCatNoAndProdCatNo2(final Integer prCatNo, final Integer prCatNo2) {
        return (ArticleType) getHibernateTemplate().execute(new HibernateCallback() {

            @SuppressWarnings("unchecked")
            public Object doInHibernate(final Session session) {
                Criteria criteria = session.createCriteria(ArticleType.class);
               
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<NokkelTransportV> findBetweenYearWeek(
      final YearWeek fromYearWeek, final YearWeek toYearWeek,
      final String productArea) {
    return (List<NokkelTransportV>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(Session session)
              throws HibernateException {
            String query = "select nokkelTransportV "
                + "      from NokkelTransportV nokkelTransportV "
View Full Code Here

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

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

  @SuppressWarnings("unchecked")
  public final List<Supplier> findByTypeName(final String typeString,
      final String orderBy) {
    return (List<Supplier>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            Criteria crit = session.createCriteria(Supplier.class);

            if (orderBy != null) {
View Full Code Here

  }

 
  public final Supplier findByName(final String name) {
    return (Supplier) getHibernateTemplate().execute(
        new HibernateCallback() {

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

  @SuppressWarnings("unchecked")
  public final List<Supplier> findActiveByTypeName(final String typeString,
      final String orderBy, final ProductAreaGroup productAreaGroup) {
    return (List<Supplier>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            Criteria crit = session
                .createCriteria(Supplier.class)
                .add(
View Full Code Here

  @SuppressWarnings("unchecked")
  public final List<Supplier> findHavingAssembly(final Integer year,
      final Integer fromWeek, final Integer toWeek,
      final ProductAreaGroup productAreaGroup) {
    return (List<Supplier>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            String sqlProductAreaGroup = "select supplier from Supplier supplier "
                + "      where exists(select 1 from Assembly assembly "
                + "                     where (assembly.inactive is null or "
View Full Code Here

    @SuppressWarnings("unchecked")
    public final List<TransportCostBasis> findById(
            final Integer transportCostBasisId) {
        return (List<TransportCostBasis>) getHibernateTemplate().execute(
                new HibernateCallback() {

                    public Object doInHibernate(final Session session) {
                        return session.createCriteria(TransportCostBasis.class)
                                .add(
                                        Restrictions.eq("transportCostBasisId",
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.