Package org.orm

Examples of org.orm.PersistentTransaction


         */
        if (ormPalabrasemanticases==null) {
          /*
           * Agrego
           */
          PersistentTransaction t = orm.MercadoPublico2PersistentManager.instance().getSession().beginTransaction();
          try {
            orm.Tmp_palabrasemantica lormPalabrasemanticas = orm.Tmp_palabrasemanticaDAO.createTmp_palabrasemantica();
            lormPalabrasemanticas.setPs_palabra(word);
            lormPalabrasemanticas.setPs_valor(valor);
            // Initialize the properties of the persistent object here
            orm.Tmp_palabrasemanticaDAO.save(lormPalabrasemanticas);
            t.commit();

            respuestas = 1;
          }
          catch (Exception e) {
            t.rollback();
            /*
             * -3 if exist error in ORM tier
             */

            respuestas = -3;
View Full Code Here


      orm.Tmp_categoria_palabra lormTmp_categoria_palabra;
      try {
        lormTmp_categoria_palabra = orm.Tmp_categoria_palabraDAO.loadTmp_categoria_palabraByQuery("cp_nombre='"+category+"'", null);
        if (lormTmp_categoria_palabra==null) {
         
          PersistentTransaction t = orm.MercadoPublico2PersistentManager.instance().getSession().beginTransaction();
         
          try {
            orm.Tmp_categoria_palabra lormTmp_categoria_palabraNueva = orm.Tmp_categoria_palabraDAO.createTmp_categoria_palabra();
            lormTmp_categoria_palabraNueva.setCp_nombre(category);
            orm.Tmp_categoria_palabraDAO.save(lormTmp_categoria_palabraNueva);
            respuesta = 1;
            t.commit();
          }
          catch (Exception e) {
            t.rollback();
            /*
             * Error transaction
             */
            respuesta = -5;
          }
View Full Code Here

         */
        if (ormPalabrasemanticases==null) {
          /*
           * Agrego
           */
          PersistentTransaction t = orm.MercadoPublico2PersistentManager.instance().getSession().beginTransaction();
          try {
            orm.Tmp_palabrasemantica lormPalabrasemanticas = orm.Tmp_palabrasemanticaDAO.createTmp_palabrasemantica();
            lormPalabrasemanticas.setPs_palabra(word);
            lormPalabrasemanticas.setPs_valor(value);
            lormPalabrasemanticas.setPs_cp(lormTmp_categoria_palabra);
            // Initialize the properties of the persistent object here
            orm.Tmp_palabrasemanticaDAO.save(lormPalabrasemanticas);
            t.commit();

            respuestas = 1;
          }
          catch (Exception e) {
            t.rollback();
            /*
             * -3 if exist error in ORM tier
             */

            respuestas = -3;
View Full Code Here

* Ingreso de Registro
* @param oContactoVO
* @return
*/
  public String agregarContacto(domain.ContactoVO oContactoVO){
    PersistentTransaction t;
    try {
      t = orm.Taller1MagisterInformaticaPersistentManager.instance().getSession().beginTransaction();
      try {
        orm.Contacto lormContacto = orm.ContactoDAO.createContacto();
        // Initialize the properties of the persistent object here
        lormContacto.setNombre(oContactoVO.getNombre());
        lormContacto.setApellido(oContactoVO.getApellido());
        lormContacto.setMail(oContactoVO.getMail());
        lormContacto.setTelefono(oContactoVO.getTelefono());
        System.out.println("Ingreso Exitoso");
        orm.ContactoDAO.save(lormContacto);
        t.commit();
        return "ingreso existoso";
      }
      catch (Exception e) {
        t.rollback();
        return "Error-Rollback";
      }
    } catch (PersistentException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
View Full Code Here

   * @throws PersistentException
   */
  private String addToken(Long datecreated, Long dateexpired, orm.Tau_userbackend lormTau_userbackend) throws PersistentException{
    String respuesta = "";
    String token = lormTau_userbackend.getUb_user() + "_" +datecreated+"_"+dateexpired;
    PersistentTransaction t = orm.AuthPersistentManager.instance().getSession().beginTransaction();
    try {
      orm.Tau_sessionuserbackend lormTau_sessionuserbackend = orm.Tau_sessionuserbackendDAO.createTau_sessionuserbackend();
      lormTau_sessionuserbackend.setSb_ub(lormTau_userbackend);
      lormTau_sessionuserbackend.setSb_datecreated(datecreated);
      lormTau_sessionuserbackend.setSb_dateexpired(dateexpired);
      lormTau_sessionuserbackend.setSb_token(token);
      orm.Tau_sessionuserbackendDAO.save(lormTau_sessionuserbackend);
      t.commit();
      respuesta = token;
    }
    catch (Exception e) {
      t.rollback();
    }
   
    return respuesta;
  }
View Full Code Here

*/
  public int addUser(String user, String password){
   
    int respuesta = 0;
    if(user!=null && user.replace(" ","")!="" && password!=null && password.replace(" ","")!="" ){
    PersistentTransaction t;
    try {
     
      /*
       * If exits username
       */
      orm.Tau_userbackend lormTau_userbackend = orm.Tau_userbackendDAO.loadTau_userbackendByQuery(" ub_user='"+user+"'", null);
      if(lormTau_userbackend==null){
        /*
         * Save
         */
        t = orm.AuthPersistentManager.instance().getSession().beginTransaction();
        try {
          orm.Tau_userbackend lormTau_userbackendCreate = orm.Tau_userbackendDAO.createTau_userbackend();
          lormTau_userbackendCreate.setUb_password(password);
          lormTau_userbackendCreate.setUb_user(user);
          // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tau_sessionuserfrontend, uf_password, uf_user
          orm.Tau_userbackendDAO.save(lormTau_userbackendCreate);
          t.commit();
         
          lormTau_userbackendCreate = null;
          respuesta = 1;
        }
        catch (Exception e) {
          t.rollback();
          /*
           * Error al guardar
           */
          respuesta = -1;
        }
View Full Code Here

   */
    public int addUser(String user, String password){
     
      int respuesta = 0;
      if(user!=null && user.replace(" ","")!="" && password!=null && password.replace(" ","")!="" ){
      PersistentTransaction t;
      try {
       
        /*
         * If exits username
         */
        orm.Tau_userfrontend lormTau_userfrontend = orm.Tau_userfrontendDAO.loadTau_userfrontendByQuery(" uf_user='"+user+"'", null);
        if(lormTau_userfrontend==null){
          /*
           * Save
           */
          t = orm.AuthPersistentManager.instance().getSession().beginTransaction();
          try {
            orm.Tau_userfrontend lormTau_userfrontendCreate = orm.Tau_userfrontendDAO.createTau_userfrontend();
            lormTau_userfrontendCreate.setUf_password(password);
            lormTau_userfrontendCreate.setUf_user(user);
            // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tau_sessionuserfrontend, uf_password, uf_user
            orm.Tau_userfrontendDAO.save(lormTau_userfrontendCreate);
            t.commit();
           
            lormTau_userfrontendCreate = null;
            respuesta = 1;
          }
          catch (Exception e) {
            t.rollback();
            respuesta = -1;
          }
         
        }
        else {
View Full Code Here

TOP

Related Classes of org.orm.PersistentTransaction

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.