UserRepository.java 591 Bytes
Newer Older
manxiaoqiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package common.repository;

import common.model.Menu;
import common.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface UserRepository extends JpaRepository<User, Long> {

	@Query(value="select * from User where email = ?1 and password = ?2",nativeQuery=true)
	User login(String email, String pwd);

	@Query(value="select * from User where id = ?1",nativeQuery=true)
	User findOne(Long id);
}