Implement the RESTFUL API for creating a BidList Entity to do the Spring Data Repository:
- Implement the RESTFUL API for reading a
BidList Entity from the existing Spring DataRepository
- Implement the RESTFUL API for updating a
BidList Entity from the existing Spring DataRepository
- Implement the RESTFUL API for deleting a
BidList Entity from the existing Spring Data Repository
Add attributes to the BidList entity class
- Integer BidListId;
- String account;
- String type;
- Double bidQuantity;
- Double askQuantity;
- Double bid;
- Double ask;
- String benchmark;
- Timestamp bidListDate;
- String commentary;
- String security;
- String status;
- String trader;
- String book;
- String creationName;
- Timestamp creationDate;
- String revisionName;
- Timestamp revisionDate;
- String dealName;
- String dealType;
- String sourceListId;
- String side;
Fix the database column and entity field names mapping
The next step is to ensure that each entity field name is mapped to the corresponding database column name, for instance:
@Column(name = "status") // Database column name
private String status; // Entity field name
‼️ PROBLEM: The original database column names is NON conventional (🌴)
with a mix of:
- PascalCase:
BidList
- Plural:
Users
whereas the conventional naming convention is:
- snake_case and lowercase:
bid_list
- singular:
user
Fix this both in the database tables creation SQL script and the entity class.
Configure audit fields
BidList.creationDate: when this entity was created
- Should not be null, nor updated once set.
@CreatedDate
@Column(name = "creation_date", nullable = false, updatable = false)
private Instant creationDate;
- Update the database column accordingly in the schema file
- Use the
Instant data type to take into account the time zone
BidList.revisionDate: the date when this entity was last modified
- Should not be null, but can be updated
@LastModifiedDate
@Column(name = "revision_date", nullable = false)
private Instant revisionDate;
Implement the RESTFUL API for creating a
BidListEntity to do the Spring Data Repository:BidListEntity from the existing Spring DataRepositoryBidListEntity from the existing Spring DataRepositoryBidListEntity from the existing Spring Data RepositoryAdd attributes to the
BidListentity classFix the database column and entity field names mapping
The next step is to ensure that each entity field name is mapped to the corresponding database column name, for instance:
with a mix of:
BidListUserswhereas the conventional naming convention is:
bid_listuserFix this both in the database tables creation SQL script and the entity class.
Configure audit fields
BidList.creationDate: when this entity was createdInstantdata type to take into account the time zoneBidList.revisionDate: the date when this entity was last modified