forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99bd30c
commit f308c15
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,47 @@ | ||
@startuml | ||
package com.iluwatar.activerecord { | ||
abstract class RecordBase<T extends RecordBase<?>> { | ||
- dataSource : DataSource | ||
- clazz : Class<T> | ||
+ setDataSource(DataSource) : void | ||
# getConnection() : Connection | ||
# abstract getTableName() : String | ||
# abstract setFieldsFromResultSet(ResultSet rs) : void | ||
# abstract setPreparedStatementParams(PreparedStatement pstmt) : void | ||
+ findAll() : List<T> | ||
+ findById(Long id): T | ||
+ save() : void | ||
+ delete() : void | ||
- constructFindByIdQuery() : String | ||
- constructFindAllQuery() : String | ||
- getDeclaredClassInstance() : T | ||
} | ||
|
||
class Customer extends RecordBase { | ||
- id : Long | ||
- customerNumber : String | ||
- firstName : String | ||
- lastName : String | ||
- List<Order> orders | ||
+ getId() : Long | ||
+ setId(Long id) : void | ||
+ getCustomerNumber() : String | ||
+ setCustomerNumber(String customerNumber) : void | ||
+ getfirstName() : String | ||
+ setFirstName(String firstName) : void | ||
+ getLastName() : String | ||
+ setLastName(String lastName) : void | ||
+ findByNumber(String customerNumber) : Customer | ||
+ addOrder(Order order) : void | ||
} | ||
|
||
class Order extends RecordBase { | ||
- id : Long | ||
- orderNumber : String | ||
+ getId() : Long | ||
+ setId(Long id) : void | ||
+ getOrderNumber() : String | ||
+ setOrderNumber(String orderNumber) : String | ||
} | ||
} | ||
@enduml |