Package com.github.dactiv.orm.annotation

Examples of com.github.dactiv.orm.annotation.StateDelete


   */
  @Override
  public boolean onDelete(Serializable id, E entity,JpaSupportRepository<E, ID> persistentContext) {
   
    Class<?> entityClass = ReflectionUtils.getTargetClass(entity);
    StateDelete stateDelete = ReflectionUtils.getAnnotation(entityClass,StateDelete.class);
    if (stateDelete == null) {
      return Boolean.TRUE;
    }
   
    Object value = ConvertUtils.convertToObject(stateDelete.value(), stateDelete.type().getValue());
    ReflectionUtils.invokeSetterMethod(entity, stateDelete.propertyName(), value);
    persistentContext.save(entity);
   
    return Boolean.FALSE;
  }
View Full Code Here


   */
  @Override
  public boolean onDelete(Serializable id, E entity,BasicHibernateDao<E, ID> persistentContext) {
   
    Class<?> entityClass = ReflectionUtils.getTargetClass(entity);
    StateDelete stateDelete = ReflectionUtils.getAnnotation(entityClass,StateDelete.class);
    if (stateDelete == null) {
      return Boolean.TRUE;
    }
   
    Object value = ConvertUtils.convertToObject(stateDelete.value(), stateDelete.type().getValue());
    ReflectionUtils.invokeSetterMethod(entity, stateDelete.propertyName(), value);
    persistentContext.update(entity);
   
    return Boolean.FALSE;
  }
View Full Code Here

TOP

Related Classes of com.github.dactiv.orm.annotation.StateDelete

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.