Which of the following attributes will be in corresponding generated static metamodel class for the rooms field?

The developer has defined the following entity class office:

Which of the following attributes will be in corresponding generated static metamodel class for the rooms field?

The developer has defined the following entity class office:

Which of the following attributes will be in corresponding generated static metamodel class for the rooms field?

A.
Public static volatile CollectionAttribute<Room> rooms;

B.
Public static volatile ListAttribute<Room> rooms;

C.
Public static volatile ListAttribute<Office, Room> rooms;

D.
Public static volatile SingleAttribute<Room> rooms;



Leave a Reply 8

Your email address will not be published. Required fields are marked *


Mohamed Fayek

Mohamed Fayek

Answer : C

For every persistent collection-valued attribute z declared by class X, where the element type of z is Z, the metamodel class must contain a declaration as follows: if the collection type of z is java.util.List, then  public static volatile ListAttribute z;

Mohamed Fayek

Mohamed Fayek

Answer : C

explanation:

• For every persistent non-collection-valued attribute y declared by class X,

where the type of y is Y, the metamodel class must contain a declaration as follows:
public static volatile SingularAttribute y;

• For every persistent collection-valued attribute z declared by class X, where the element type of z is Z, the metamodel class must contain a declaration as follows:    

• if the collection type of z is java.util.Collection, then     
public static volatile CollectionAttribute z;     

• if the collection type of z is java.util.Set, then     
public static volatile SetAttribute z;     

• if the collection type of z is java.util.List, then     
public static volatile ListAttribute z;     

• if the collection type of z is java.util.Map, then     
public static volatile MapAttribute z;     
where K is the type of the key of the map in class X