-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmm_jdl.jdl
83 lines (72 loc) · 1.68 KB
/
mm_jdl.jdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* User Profile entity
*/
entity UserProfile {
firstName String required,
lastName String required,
dateOfBirth LocalDate required
}
/**
* Address entity
*/
entity Address {
houseNumber Integer min(1) required,
street String required pattern(/[a-zA-Z]+\s(St|Rd|Ave|Blvd|Cir|Dr|Pl|Sq)./),
apartmentNumber Integer min(1),
city String required pattern(/[a-zA-Z]+/),
state String required pattern(/[a-zA-Z]{2}/),
zip String required pattern(/[0-9]{5}/)
}
/**
* BankAccount entity
*/
entity BankAccount {
accountNumber Long min(0) max(999999999) unique,
routingNumber Integer min(123456789) max(123456789),
@defaultValue(0)
balance Double,
type Type required
}
/**
* BankAccount type enum
*/
enum Type {
CHECKING,
SAVINGS,
PLACEHOLDER,
MONEY_MARKET_CHECKING
}
/**
* Transaction entity
*/
entity Transaction {
@defaultValue(0)
transactionValue Double
}
relationship OneToOne {
/**
* Associate each UserProfile with a User
*/
UserProfile to @OnDelete("CASCADE") @Id User with builtInEntity
}
relationship OneToMany {
/**
* Associate each UserProfile with an Address
*/
Address to UserProfile{address}
/**
* Associate each BankAccount with a UserProfile
*/
UserProfile to BankAccount{accountHolder}
}
relationship ManyToOne {
/**
* Associate each Transaction with a source BankAccount
*/
Transaction{source} to BankAccount{transactionsOut}
/**
* Associate each Transaction with a destination BankAccount
*/
Transaction{destination} to BankAccount{transactionsIn}
}
paginate BankAccount, Transaction with pagination