Skip to content

Commit f164a18

Browse files
authored
Merge pull request #24 from UdL-EPS-SoftArch/customer
feat: relations of customer class made, and CustomerRepository created
2 parents cd53fba + 8259dd1 commit f164a18

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/main/java/cat/udl/eps/softarch/demo/domain/Customer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ public class Customer extends User {
2929
public Collection<? extends GrantedAuthority> getAuthorities() {
3030
return AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_CUSTOMER");
3131
}
32+
33+
//TODO
34+
// @OneToOne
35+
// private Basket basket;
36+
37+
//TODO
38+
// @OneToMany(mappedBy = "products")
39+
// private Set<Order> orders;
40+
41+
//TODO
42+
// @OneToOne
43+
// private Loyalty loyalty;
3244
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cat.udl.eps.softarch.demo.repository;
2+
3+
import cat.udl.eps.softarch.demo.domain.Customer;
4+
import org.springframework.data.repository.CrudRepository;
5+
import org.springframework.data.repository.PagingAndSortingRepository;
6+
7+
import java.util.List;
8+
9+
public interface CustomerRepository extends CrudRepository<Customer, Long>, PagingAndSortingRepository<Customer, Long> {
10+
11+
List<Customer> findByPhoneNumber(String phone);
12+
List<Customer> findByName(String name);
13+
14+
}

0 commit comments

Comments
 (0)