Skip to content

Commit

Permalink
Replace field injection & mutability
Browse files Browse the repository at this point in the history
  • Loading branch information
HliasMpGH committed Dec 16, 2024
1 parent 4590527 commit 07742e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion gui/src/main/java/gr/bibliotech/data/BookRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
@Repository
public class BookRepository {

private final JdbcTemplate jdbcTemplate;

@Autowired
private JdbcTemplate jdbcTemplate;
public BookRepository(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}

/**
* Retrieves the Registered Books from the Data Base
Expand Down
2 changes: 1 addition & 1 deletion gui/src/main/java/gr/bibliotech/data/BookService.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Service
public class BookService {

private BookRepository bookRepository;
private final BookRepository bookRepository;

@Autowired
public BookService(BookRepository bookRepository) {
Expand Down
6 changes: 5 additions & 1 deletion gui/src/main/java/gr/bibliotech/data/UserRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
@Repository
public class UserRepository {

private final JdbcTemplate jdbcTemplate;

@Autowired
JdbcTemplate jdbcTemplate;
public UserRepository(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}

/**
* Retrieves the Registered Users from the Data Base.
Expand Down
2 changes: 1 addition & 1 deletion gui/src/main/java/gr/bibliotech/data/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@Service
public class UserService {

private UserRepository userRepository;
private final UserRepository userRepository;

@Autowired
public UserService(UserRepository userRepository) {
Expand Down

0 comments on commit 07742e6

Please sign in to comment.