Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTemplate.execute()


  public long staccaNumeroArticolo() throws ImpossibileGenerareNumeroArticoloException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select SQ_ARTICOLI.NEXTVAL from DUAL")
              .uniqueResult();
          return nextVal.longValue();
        }
View Full Code Here


  public long staccaNumeroArticoloCustom() throws ImpossibileGenerareNumeroArticoloCustomException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery(
              "select SQ_MOVCONT_" + legalEntity + "_" + organizationUnit + ".NEXTVAL from DUAL")
              .uniqueResult();
          return nextVal.longValue();
View Full Code Here

  public long staccaNumeroFattura() throws ImpossibileGenerareNumeroFatturaException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select SQ_FATTURE.NEXTVAL from DUAL")
              .uniqueResult();
          return nextVal.longValue();
        }
View Full Code Here

  public long staccaNumeroFatturaCustom() throws ImpossibileGenerareNumeroFatturaCustomException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery(
              "select SQ_TESTATA_FATTURA_" + legalEntity + "_" + organizationUnit + ".NEXTVAL from DUAL")
              .uniqueResult();
          return nextVal.longValue();
View Full Code Here

  public long staccaNumeroMovimentoLegale() throws ImpossibileGenerareChiaveMovimentoLegaleException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select movleg_num.nextval from DUAL")
              .uniqueResult();
          return nextVal.longValue();
        }
View Full Code Here

  public long staccaNumeroConto() throws ImpossibileGenerareNumeroContoException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select SQ_CONTI.NEXTVAL from DUAL")
              .uniqueResult();
          return nextVal.longValue();
        }
View Full Code Here

  public long staccaNumeroAntiMafia() throws ImpossibileGenerareNumeroAntiMafiaException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    Long execute = 0l;
    try {
      execute = (Long) hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) {
          BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select sq_antm.nextval from DUAL")
              .uniqueResult();
          return nextVal.longValue();
        }
View Full Code Here

 
  @Override
  // il metodo nel ContabilitaDaoHibernateImpl andrebbe tolto e andrebbe lasciato solo questo
  public long staccaNumeroArticolo() throws ImpossibileGenerareNumeroArticoloException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    return (Long) hibernateTemplate.execute(new HibernateCallback() {
      public Object doInHibernate(Session session) {
        BigDecimal nextVal = (BigDecimal) session.createSQLQuery("select SQ_ARTICOLI.NEXTVAL from DUAL")
            .uniqueResult();
        return nextVal.longValue();
      }
View Full Code Here

 
  @Override
  // il metodo nel ContabilitaDaoHibernateImpl andrebbe tolto e andrebbe lasciato solo questo
  public long staccaNumeroArticoloCustom() throws ImpossibileGenerareNumeroArticoloCustomException {
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    return (Long) hibernateTemplate.execute(new HibernateCallback() {
      public Object doInHibernate(Session session) {
        BigDecimal nextVal = (BigDecimal) session.createSQLQuery(
            "select SQ_MOVCONT_" + legalEntity + "_" + organizationUnit + ".NEXTVAL from DUAL")
            .uniqueResult();
        return nextVal.longValue();
View Full Code Here

  }

  public WOJObject find(final Long id) throws DaoException {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());

        return (WOJObject) t.execute(
            new HibernateCallback() {
                public Object doInHibernate(Session s) throws HibernateException, SQLException {
                    return s.createCriteria(_handledClass).add(Restrictions.eq("id", id)).uniqueResult();
                }
            }
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.