File tree Expand file tree Collapse file tree 18 files changed +224
-0
lines changed
main/java/com/iluwatar/daofactory
test/java/com/iluwatar/daofactory Expand file tree Collapse file tree 18 files changed +224
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <modelVersion >4.0.0</modelVersion >
6
+ <parent >
7
+ <groupId >com.iluwatar</groupId >
8
+ <artifactId >java-design-patterns</artifactId >
9
+ <version >1.26.0-SNAPSHOT</version >
10
+ </parent >
11
+
12
+ <artifactId >dao-factory</artifactId >
13
+
14
+ <properties >
15
+ <maven .compiler.source>21</maven .compiler.source>
16
+ <maven .compiler.target>21</maven .compiler.target>
17
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
18
+ </properties >
19
+
20
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:22
8
+ * Filename : Customer
9
+ */ public class Customer {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:16
8
+ * Filename : CustomerDAO
9
+ */ public interface CustomerDAO {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:16
8
+ * Filename : DAOFactory
9
+ */ public interface DAOFactory {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 17/04/2025
7
+ * Time : 00:21
8
+ * Filename : DataSourceEnum
9
+ */
10
+ public class DataSourceEnum {
11
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:25
8
+ * Filename : FlatFileCustomerDAO
9
+ */
10
+ public class FlatFileCustomerDAO {
11
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:19
8
+ * Filename : FlatFileDataSourceFactory
9
+ */ public class FlatFileDataSourceFactory {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:26
8
+ * Filename : H2CustomerDAO
9
+ */ public class H2CustomerDAO {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:18
8
+ * Filename : H2DataSourceFactory
9
+ */ public class H2DataSourceFactory {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ import org .dizitart .no2 .collection .Document ;
4
+ import java .util .Optional ;
5
+
6
+ /**
7
+ * Created by: IntelliJ IDEA
8
+ * User : dthanh
9
+ * Date : 16/04/2025
10
+ * Time : 23:26
11
+ * Filename : NitriteCustomerDAO
12
+ */
13
+ public class MongoCustomerDAO implements CustomerDAO {
14
+ @ Override
15
+ public void save (Customer customer ) {
16
+
17
+ }
18
+
19
+ @ Override
20
+ public void update (Customer customer ) {
21
+
22
+ }
23
+
24
+ @ Override
25
+ public void delete (Long id ) {
26
+
27
+ }
28
+
29
+ @ Override
30
+ public Optional <Customer > findById (Long id ) {
31
+ return Optional .empty ();
32
+ }
33
+
34
+ // @Override
35
+ // public List<Customer> findAll() {
36
+ // return List.of();
37
+ // }
38
+ //
39
+ // @Override
40
+ // public Optional<Customer> findById(Long id) {
41
+ // return Optional.empty();
42
+ // }
43
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 16/04/2025
7
+ * Time : 23:19
8
+ * Filename : NitriteDataSourceFactory
9
+ */
10
+ public class MongoDataSourceFactory extends DAOFactory {
11
+ @ Override
12
+ public CustomerDAO getCustomerDAO () {
13
+ return new MongoCustomerDAO ();
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:02
8
+ * Filename : AppTest
9
+ */ public class AppTest {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:03
8
+ * Filename : CustomerTest
9
+ */
10
+ public class CustomerTest {
11
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:01
8
+ * Filename : DAOFactoryTest
9
+ */
10
+ public class DAOFactoryTest {
11
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:05
8
+ * Filename : FlatFileCustomerDAOTest
9
+ */ public class FlatFileCustomerDAOTest {
10
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:05
8
+ * Filename : H2CustomerDAOTest
9
+ */
10
+ public class H2CustomerDAOTest {
11
+ }
Original file line number Diff line number Diff line change
1
+ package com .iluwatar .daofactory ;
2
+
3
+ /**
4
+ * Created by: IntelliJ IDEA
5
+ * User : dthanh
6
+ * Date : 21/04/2025
7
+ * Time : 01:05
8
+ * Filename : MongoCustomerDAOTest
9
+ */
10
+ public class MongoCustomerDAOTest {
11
+ }
You can’t perform that action at this time.
0 commit comments