abstract class는 구체화된 클래스와 거의 같지만 객체화할 수는 없다.
Abstract entity는 구체화된 entity처럼 쿼리할 수 있다. 만약 abstract entity가 query의
목표라면, query는 abstract entity의 하위 모든 구체화된 클래스에 동작한다.
@Entity
public abstract class Employee {
@Id
protected Integer employeeId;
...
}
@Entity
public class FullTimeEmployee extends Employee {
protected Integer salary;
...
}
@Entity
public class PartTimeEmployee extends Employee {
protected Float hourlyWage;
}
original source : https://docs.oracle.com/javaee/6/tutorial/doc/bnbqn.html
댓글 없음 :
댓글 쓰기