Package com.structis.fichesst.server.bean.core

Examples of com.structis.fichesst.server.bean.core.Activable


    if( null != x && null != y ) {

      // Mapping Server Bean => Client Model
      if( x instanceof Activable && y instanceof ModelActivable ) {
        Activable activable = (Activable) x;
        ModelActivable modelActivable = (ModelActivable) y;
        if( null == activable.getDateSuppr() ) {
          // S'il n'a pas de dateSuppr => active
          modelActivable.setActive(true);
          modelActivable.setDateSuppr(null);
        }
        else {
          // Si non �tat inactive
          modelActivable.setActive(false);
          modelActivable.setDateSuppr(activable.getDateSuppr());
        }

      }

      // Mapping Client Model => Server Bean
      if( y instanceof Activable && x instanceof ModelActivable ) {
        Activable activable = (Activable) y;
        ModelActivable modelActivable = (ModelActivable) x;
        if( modelActivable.getActive() ) {
          // S'il est active => DateSuppr est null
          activable.setDateSuppr(null);
        }
        else {
          // Sinon
          if( null == modelActivable.getDateSuppr() ) {
            // Nouvelle activation + New Date
            activable.setDateSuppr(dateMapper.getActualDate());
          }
          else {
            // Old Date
            activable.setDateSuppr(modelActivable.getDateSuppr());
          }
        }
      }

      if( logger.isDebugEnabled() )
View Full Code Here

TOP

Related Classes of com.structis.fichesst.server.bean.core.Activable

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.