RoleRepository.java
702 Bytes
package com.bsth.repository;
import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.bsth.entity.sys.Role;
@Repository
public interface RoleRepository extends BaseRepository<Role, Integer>{
/**
* @Title: update
* @Description: TODO(简洁版更新(不需要级联的))
*/
@Modifying
@Transactional
@Query("update Role r set r.codeName=?1, r.roleName=?2, r.enable=?3, r.descriptions=?4 where r.id=?5")
void update(String codeName, String roleName, boolean enable, String descriptions, Integer id);
}