[code]17. Given the definition for an entity, Book:
- @Entity
- public class Book {
- @Id Integer id;
- @Column(name=“NAMEBOOK”)
- String bookName;
- public java.util.Date loanDate;
- }
The associated descriptor file has the following snippet pertaining to this entity:
-
<table name="BOOKTB"/> -
<attributes> -
<basic name="bookName"> -
<column name="TOMENAME"/> -
</basic> -
<basic name="loanDate"> -
<temporal>DATE</temporal> -
</basic> -
</attributes>
No other parts of the deployment descriptor affect this configuration. Which statement about the persistent unit and descriptor is correct?
A.The descriptor will ensure that the table BOOKTB is used to map the entity Book, and that bookName is mapped to column NAMEBOOK within this table.
B.The descriptor ensures that the table BOOKTB is used to map the entity Book, and that bookName is mapped to column TOMENAME within this table.
C.This persistent unit does NOT deploy because an annotation is missing on the Book entity class.
D.This persistent unit does NOT deploy because the descriptor information is NOT complete.[/code]
A resposta certa é a D. Mas eu tinha colocado como B, pois não vejo nada de incompleto no descriptor que pode não estar declarando o ID da entity, mas como ele não está declarado no descriptor quer dizer que ele não deu override e vale o da anotação, não é ?
Por favor quem souber ajuda aí !
Agradeço desde já ! =)