You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Birmingham, Steven" <St...@itt.com> on 2010/02/26 23:05:00 UTC

OCM complex class can be annotated?

Hello,

I am new to JCR but have been playing with JackRabbit.  I have version 2.0 installed.  I built the ocm project and also have the dependencies working so that I have the simple PressRelease example working.  I was trying to persist a test class we have here and get the exception:  Class of type: com.ist.jcr.jackrabbit.test.OcmSigIntData has no descriptor.  I am trying to use annotations.  Can something like this work or am I forced to do build a descriptor?  FYI, DataSystem, SignalType, Site and SourceSystem are enums.

Here is the class:
package com.ist.jcr.jackrabbit.test;

import java.util.Date;
import java.util.List;
import java.util.AbstractMap.SimpleEntry;

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;

import com.ist.proposal.data.enums.DataSystem;
import com.ist.proposal.data.enums.SignalType;
import com.ist.proposal.data.enums.Site;
import com.ist.proposal.data.enums.SourceSystem;

@Node
public class OcmSigIntData {
      @Field(path=true) String path;
      @Field private DataSystem dataSystem;
      @Field private String description;
      @Field private SimpleEntry<Date, Date> eventDates;
      @Field private long eventId;
      @Field private SimpleEntry<SimpleEntry<Double, Double>, SimpleEntry<Double, Double>> location;
      @Collection private List<SimpleEntry<Integer, Integer>> rfs;
      @Collection private List<SimpleEntry<Date, Date>> signalTimes;
      @Field private SignalType signalType;
      @Field private Site site;
      @Field private SourceSystem sourceSystem;
      @Field private String summary;
      @Field private String title;

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

      public DataSystem getDataSystem() {
            return dataSystem;
      }
      public void setDataSystem(DataSystem dataSystem) {
            this.dataSystem = dataSystem;
      }
      public String getDescription() {
            return description;
      }
      public void setDescription(String description) {
            this.description = description;
      }
      public SimpleEntry<Date, Date> getEventDates() {
            return eventDates;
      }
      public void setEventDates(SimpleEntry<Date, Date> eventDates) {
            this.eventDates = eventDates;
      }
      public long getEventId() {
            return eventId;
      }
      public void setEventId(long eventId) {
            this.eventId = eventId;
      }
      public SimpleEntry<SimpleEntry<Double, Double>, SimpleEntry<Double, Double>> getLocation() {
            return location;
      }
      public void setLocation(
                  SimpleEntry<SimpleEntry<Double, Double>, SimpleEntry<Double, Double>> location) {
            this.location = location;
      }
      public List<SimpleEntry<Integer, Integer>> getRfs() {
            return rfs;
      }
      public void setRfs(List<SimpleEntry<Integer, Integer>> rfs) {
            this.rfs = rfs;
      }
      public List<SimpleEntry<Date, Date>> getSignalTimes() {
            return signalTimes;
      }
      public void setSignalTimes(List<SimpleEntry<Date, Date>> signalTimes) {
            this.signalTimes = signalTimes;
      }
      public SignalType getSignalType() {
            return signalType;
      }
      public void setSignalType(SignalType signalType) {
            this.signalType = signalType;
      }
      public Site getSite() {
            return site;
      }
      public void setSite(Site site) {
            this.site = site;
      }
      public SourceSystem getSourceSystem() {
            return sourceSystem;
      }
      public void setSourceSystem(SourceSystem 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;
      }
      @Override
      public String toString() {
            StringBuffer sb = new StringBuffer();
            sb.append("Title: ").append(title).append("\n");
            sb.append("Description: ").append(description).append("\n");
            sb.append("Summary: ").append(summary).append("\n");
            sb.append("EventId: ").append(eventId).append("\n");
            sb.append("SignalType: ").append(signalType).append("\n");
            sb.append("DataSystem: ").append(dataSystem).append("\n");
            sb.append("SourceSystem: ").append(sourceSystem).append("\n");
            sb.append("Site: ").append(site).append("\n");
            sb.append("Location: [")
                  .append(location.getKey().getKey()).append("|")
                  .append(location.getKey().getValue()).append("|")
                  .append(location.getValue().getKey()).append("|")
                  .append(location.getValue().getValue()).append("]\n");
            sb.append("EventDate: ").append("\n")
                  .append("  Start: ").append(eventDates.getKey()).append("\n")
                  .append("    End: ").append(eventDates.getValue()).append("\n");
            sb.append("SignalTimes: ").append("\n");
            for (int i = 0; i < signalTimes.size(); i++) {
                  sb.append("  Start: ").append(signalTimes.get(i).getKey()).append("\n");
                  sb.append("    End: ").append(signalTimes.get(i).getValue()).append("\n");
            }
            sb.append("Rfs: ").append("\n");
            for (int i = 0; i < rfs.size(); i++) {
                  sb.append("  Rf: [").append(rfs.get(i).getKey()).append(",").append(rfs.get(i).getValue()).append("]\n");
            }
            return sb.toString();
      }

}


________________________________
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.