views:

39

answers:

1

Hi everybody,

I have three classes -> Metadata, MetadataValue and MetadataMetadataValue:

Metadata

private long id;
private 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

A: 
select mv.metadataValue from MetadataMetadataValue mv where mv.metadata=:object
Maurice Perry