Christophe Lombart wrote:

On 10/10/05, Martin Koci <[EMAIL PROTECTED]> wrote:
When inserting new object into repository on existing path new node with
[] index is created:

Assume node /Document And Sesstings/file.txt exists:

pm.insert("/Document And Sesstings/file.txt", entity) creates new node
with path /Document And Sesstings/file.txt[1] - that is correct.

But I want set newly inserted path on inserted entity:
entity.getPath() should return /Document And Sesstings/file.txt[1]

Is it possible?


No but I think that we have to support this feature.

Is path to node saved in special property ?


No. Costin suggest also to store the path in the mapping config file and
have method calls like :

myObject.setPath();
pm.instert(myObject)
I think path in repository is similar as identifier in ORM world. So if Hibernate has

<id name="id" column="cat_id">

</id>

for describing unique identifier we can have something like that:
<path fieldName="path">
</path>

Element can accept more attributes, for example
<path fieldName="path" sameNameSibling="false" /> says POJO cannot be inserted on existing node so creating name with [1] is not allowed.

<class-descriptor className="cz.aura.admis.domain.Document"
jcrNodeType="admis:document" >
<field-descriptor fieldName="path"
jcrName="PATH_PROPERTY_NAME"></field-descriptor> ???
<field-descriptor fieldName="creationDate"
jcrName="jcr:created"></field-descriptor>
<bean-descriptor fieldName="documentStream" proxy="false"
jcrName="jcr:content"></bean-descriptor>
</class-descriptor>



Good suggestion.

I will try to fix thoses issues this week
Thanks
Christophe



Reply via email to