- OOP 관점에서 모델링이란?

 

Class Car {

    int id; (PK)

    String name;

    String color;

    Engine engine;

    TimeStamp createDate;

    TimeStamp updateDate;

}

 

Class Engine {

    int id;

    int power;

    TimeStamp createDate;

    TimeStamp updateDate;

}

 

JPA 자동생성

 

Class EntityDate {

    TimeStamp createDate;

    TImeStamp updateData;

}

 

기존 Car, Engine  클래스에 EntityDate를 상속

Class Card extends EntityDate {}

Class Engine  extends EntityDate {}

 

 

- 방언 처리가 용이하여 Migration하기 좋음. 유지보수에도 좋음.

추상화 객체를 이용해 DB에 연결

 

 

강의 주소 : https://youtu.be/vRoZAMX95Mc

+ Recent posts