On 3/16/09 4:01 AM, "Christophe Lombart" <[email protected]>
wrote:
> Can you give more information on your mapped class (DocumentImpl) ?
> Which ocm version are you using ?
I am using the Jackrabbit OCM 1.6 snapshot, downloaded around 6 February
2009.
For a simple query, I would like to be able to return the DocumentImpl with
a specified person's name (personName).
However, if possible, eventually I would like to move the "personName"
attribute into the properties Map and query for the document based on
properties in the Map, but I am unsure of how to do this through the OCM
QueryManager right now.
<code>
@Node(discriminator=false)
public class DocumentImpl implements IDocument, Serializable{
@Field(path=true)
private String path;
@Field()
private String personName;
@Collection
private Map<String, Property> properties;
//http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/j
ava/org/apache/jackrabbit/ocm/testmodel/File.java
@Bean
private File contents;
public DocumentImpl(){
this.properties = new HashMap<String, Property>();
}
// getters and setters follow
}
@Node(discriminator=false)
public class Property {
@Field private String key;
@Field private String value;
public Property(){
this("", "");
}
public Property(String key, String value) {
super();
this.key = key;
this.value = value;
}
//getters and setters follow
}
</code>
--David