How to update a specific version in Jackrabbit using OCM Version Management

jackrabbit

73 просмотра

1 ответ

45 Репутация автора

I curious about it is possible to update a specific version of @Node model using JackRabbit OCM? For example I have a DTO like this:

@Node(jcrMixinTypes = "mix:versionable")
public class Something implements Serializable {

    private static final long serialVersionUID = 6651266612240053364L;

    @Field(path = true)
    private String path;

    @Field
    private String xml;

    @Field
    private Long version;

    public String getPath() {
        return this.path;
    }

    public void setPath(final String path) {
        this.path = path;
    }

    public String getXml() {
        return this.xml;
    }

    public void setXml(final String xml) {
        this.xml = xml;
    }    

    public Long getVersion() {
        return this.version;
    }

    public void setVersion(final Long version) {
        this.version = version;
    }

}

And created multiple versions e.q. on path name: /abc Named: 'jcr:rootVersion', '1.0', '1.1'. How can I update all of these specific versions DTO content e.g. the xml property and save in the JackRabbit repository without creating new versions?

Thank you for your help in advance!

Автор: Rómeó Nagy Источник Размещён: 18.07.2016 10:28

Ответы (1)


0 плюса

2316 Репутация автора

You can't update previous versions. Why would you want to? They are there to preserve the changes.

Or if you don't want to create a new version every time you save then don't! Are you calling check[in/out/point]? Remove them so you only save changes to the current version.

Автор: TedTrippin Размещён: 07.11.2016 05:39
Вопросы из категории :
32x32