Last change
on this file since 7944fab was b31afbd, checked in by Vzdra <vladko.zdravkovski@…>, 4 years ago |
fixed some bugs and finalized user registration
|
-
Property mode
set to
100644
|
File size:
753 bytes
|
Rev | Line | |
---|
[e6ff724] | 1 | package it.finki.tinki.model.Users;
|
---|
| 2 |
|
---|
[b31afbd] | 3 | import com.sun.istack.NotNull;
|
---|
[e6ff724] | 4 | import it.finki.tinki.model.enumerator.AccountType;
|
---|
| 5 | import lombok.Data;
|
---|
| 6 |
|
---|
| 7 | import javax.persistence.*;
|
---|
| 8 |
|
---|
| 9 | @Entity
|
---|
| 10 | @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
---|
| 11 | @Data
|
---|
| 12 | public abstract class Account {
|
---|
| 13 |
|
---|
| 14 | @Id
|
---|
| 15 | @GeneratedValue(strategy = GenerationType.AUTO)
|
---|
| 16 | Long id;
|
---|
| 17 |
|
---|
[29c0ed0] | 18 | @Column(unique = true)
|
---|
[b31afbd] | 19 | @NotNull
|
---|
[e6ff724] | 20 | String email;
|
---|
[29c0ed0] | 21 |
|
---|
[b31afbd] | 22 | @NotNull
|
---|
[e6ff724] | 23 | String password;
|
---|
| 24 |
|
---|
[b31afbd] | 25 | @NotNull
|
---|
[e6ff724] | 26 | String name;
|
---|
| 27 |
|
---|
| 28 | AccountType accountType;
|
---|
| 29 |
|
---|
| 30 | public Account(){}
|
---|
| 31 |
|
---|
| 32 | public Account(String email, String password, String name, AccountType accountType) {
|
---|
| 33 | this.email = email;
|
---|
| 34 | this.password = password;
|
---|
| 35 | this.name = name;
|
---|
| 36 | this.accountType = accountType;
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.