Hello,
Help... new to JackRabbit; I am trying to use the Bean Annotation to implement
a simple generic pair. I was hoping to only use annotations and no descriptor.
I have searched for an example but cannot find one. Here is the exception.
Exception in thread "main"
org.apache.jackrabbit.ocm.exception.ObjectContentManagerException: Impossible
to insert the bean attribute into the repository; nested exception is
org.apache.jackrabbit.ocm.exception.JcrMappingException: The bean doesn't have
an uuid - classdescriptor : com.ist.jcr.jackrabbit.test.Pair
org.apache.jackrabbit.ocm.exception.JcrMappingException: The bean doesn't have
an uuid - classdescriptor : com.ist.jcr.jackrabbit.test.Pair
at
org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl.updateReferenceProperty(ReferenceBeanConverterImpl.java:99)
at
org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl.insert(ReferenceBeanConverterImpl.java:58)
at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:844)
at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:226)
at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:155)
at
org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406)
at
com.ist.jcr.jackrabbit.test.OcmSigIntDataCreateTest.<init>(OcmSigIntDataCreateTest.java:70)
at
com.ist.jcr.jackrabbit.test.OcmSigIntDataCreateTest.main(OcmSigIntDataCreateTest.java:101)
Here are the classes I am using with the Bean class first.
package com.ist.jcr.jackrabbit.test;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
@Node(jcrType="nt:unstructured")
class Pair<Date>
{
@Field(path=true) String path;
@Field private Date startValue;
@Field private Date endValue;
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public Date getStartValue()
{
return startValue;
}
public void setStartValue(Date t)
{
startValue = t;
}
public Date getEndValue()
{
return endValue;
}
public void setEndValue(Date t)
{
endValue = t;
}
}
package com.ist.jcr.jackrabbit.test;
import java.util.Date;
import java.util.List;
import
org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
@Node(jcrType = "nt:unstructured")
public class OcmSigIntData {
@Field(path=true) String path;
@Field private String dataSystem;
@Field private String description;
@Bean(converter = ReferenceBeanConverterImpl.class) private Pair<Date>
eventDates;
@Field private long eventId;
@Bean(converter = ReferenceBeanConverterImpl.class) private
Pair<Pair<Double>> location;
@Collection private List<Pair<Integer>> rfs;
@Collection private List<Pair<Date>> signalTimes;
@Field private String signalType;
@Field private String site;
@Field private String sourceSystem;
@Field private String summary;
@Field private String title;
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getDataSystem() {
return dataSystem;
}
public void setDataSystem(String dataSystem) {
this.dataSystem = dataSystem;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Pair<Date> getEventDates() {
return eventDates;
}
public void setEventDates(Pair<Date> eventDates) {
this.eventDates = eventDates;
}
public long getEventId() {
return eventId;
}
public void setEventId(long eventId) {
this.eventId = eventId;
}
public Pair<Pair<Double>> getLocation() {
return location;
}
public void setLocation(
Pair<Pair<Double>> location) {
this.location = location;
}
public List<Pair<Integer>> getRfs() {
return rfs;
}
public void setRfs(List<Pair<Integer>> rfs) {
this.rfs = rfs;
}
public List<Pair<Date>> getSignalTimes() {
return signalTimes;
}
public void setSignalTimes(List<Pair<Date>> signalTimes) {
this.signalTimes = signalTimes;
}
public String getSignalType() {
return signalType;
}
public void setSignalType(String signalType) {
this.signalType = signalType;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getSourceSystem() {
return sourceSystem;
}
public void setSourceSystem(String sourceSystem) {
this.sourceSystem = sourceSystem;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
Thanks,
Steve
________________________________
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely
those of the author and do not necessarily represent those of ITT Corporation.
The recipient should check this e-mail and any attachments for the presence of
viruses. ITT accepts no liability for any damage caused by any virus
transmitted by this e-mail.