Skip to content

Commit 9193dd1

Browse files
committed
DTO via a custom ResultTransformer
1 parent ef8ec80 commit 9193dd1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.bookstore.dao;
2+
3+
import com.bookstore.dto.AuthorDto;
4+
import java.util.List;
5+
6+
public interface AuthorDao {
7+
8+
public List<AuthorDto> fetchAuthorWithBook();
9+
}

HibernateSpringBootDtoCustomResultTransformer/src/main/java/com/bookstore/dao/Dao.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
import org.springframework.transaction.annotation.Transactional;
1111

1212
@Repository
13-
public class Dao {
13+
public class Dao implements AuthorDao {
1414

1515
@PersistenceContext
1616
private EntityManager entityManager;
1717

18+
@Override
1819
@Transactional(readOnly = true)
1920
public List<AuthorDto> fetchAuthorWithBook() {
2021
Query query = entityManager

0 commit comments

Comments
 (0)