I have three classes -> Metadata, MetadataValue and MetadataMetadataValue:
Metadata
private long id;
privat开发者_运维知识库e Metadata parent;
private long levelInTree;
private String code;
private String nameEn;
private String nameFr;
private String descriptionEn;
private String descriptionFr;
private String query;
private String metadataType;
private String dataType;
private String permittedAsNeighbour;
private String visibility;
private long timeToLive;
private Set<MetadataMetadataValue> metadataMetadataValueList = new HashSet<MetadataMetadataValue>();
MetadataValue
private long id;
private String valueEn;
private String valueFr;
private String code;
private String codeExample;
private Set<MetadataMetadataValue> metadataMetadataValueList = new HashSet<MetadataMetadataValue>();
MetadataMetadataValue
private long id;
private Metadata metadata;
private MetadataValue metadataValue;
private long valOrder;
Each class has an Hibernate mapping file.
The associations are:
"Metadata" one-to-many "MetadataMetadataValue" many-to-one "MetadataValue"
I must do a query to get all the "MetadataValue" objects which correspond to a "Metadata" object.
Thank you
select mv.metadataValue from MetadataMetadataValue mv where mv.metadata=:object
精彩评论