public UserEntity findUserByUsername( String username ) {
QUserEntity tableUser = QUserEntity.userEntity;
JPAQuery query = new JPAQuery( entityManager )
.from( tableUser )
.where( tableUser.ds_username.eq( username ) );
return ( UserEntity ) query.singleResult( tableUser );
}
Using the last version of junit.
您可以模拟EntityManager
并验证Querydsl以您预期的方式使用EntityManager
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.