my goal is to store information about projects within Jackrabbit. Each project can consist out of several sub-projects with project related files/documents attached to them.
Consider the following structure:
-project 1
-project 1.1
-project 1.2
-project 1.2.1
-project 1.2.2
-project 2
I have a java class representing each project which looks like this:
public class Project {
@Field
private String name;
@Collection
private List<Project> subprojects;
// more properties + getter/setter
}
My questions are:
- Is there anything similar to lazy loading from ORM tools? For example: When I want to get the information about
project 1I don’t need all the information from subprojects. Whats the best way to achive this? - Whats the best way to attach binary data (files, documents, images) to a project when using OCM?
(Unfortunately the Jackrabbit OCM documentation is not really detailed)
For lazy loading, you can achieve this by specifying
proxy=truein Bean or Collection annotation.Binary data can be represented as
jcr:dataproperty ofnt:resourceso the mapping looks something like this.It is true the document of OCM is not updated, but you can find the useful information from
/org/apache/jackrabbit/ocm/config/jackrabbit-ocm-1.5.dtdundersrc/main/resourcesin the source distribution.HTH,