Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

writing wehere clause in repository in springboot

@Repository
@Transactional
public interface EmployeeDAO extends CrudRepository<Employee,Long> {
    List<Employee> findByEmployeeName(@Param("name") String name);      // using method
    @Query("SELECT e from Employee e where e.employeeName =:name ")       // using @query
    List<Employee> findByName(@Param("name") String name);
    @Query(value = "SELECT e from Employee e where e.employeeName =:name ", nativeQuery = true)    @ using @query with native
    List<Employee> findByNameNative(@Param("name") String name);
}
 
PREVIOUS NEXT
Tagged: #writing #wehere #clause #repository #springboot
ADD COMMENT
Topic
Name
6+4 =