public ome.model.annotations.MapAnnotation proxy() { return new ome.model.annotations.MapAnnotation(this.id, false); }
@Transactional(readOnly=false) @Override public Object doWork(Session session, ServiceFactory sf) { MapAnnotation ma = new MapAnnotation(); ma.setNs(NAMESPACE); ma.setDescription(parseStream(stream)); ma.setMapValue(new ArrayList<NamedValue>()); ma.getMapValue().add(new NamedValue("from", from)); ma.getMapValue().add(new NamedValue("to", recipient)); ma = sf.getUpdateService().saveAndReturnObject(ma); log.info("Saved email: MapAnnotation:" + ma.getId()); return ma; }}); }
@Override public Object retrieve(String field) { if (field == null) { return null; } else if (field.equals(MAPVALUE)) { return getMapValue(); } else { return super.retrieve(field); } }
@Override public void putAt(String field, Object value) { if (field == null) { return; } else if (field.equals(MAPVALUE)) { setMapValue((java.util.List<ome.model.internal.NamedValue>)value); } else { super.putAt(field,value); } }
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { this.mapValue = (java.util.List<ome.model.internal.NamedValue>) __filter.filter(MAPVALUE, this.mapValue ); return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
/** * Creates {@link Field} instances for {@link MapAnnotation} named-value * pair. * * @param document * @param opts * @param mapAnnotation */ private void handleMapAnnotation(final Document document, final LuceneOptions opts, MapAnnotation mapAnnotation) { List<NamedValue> nvs = mapAnnotation.getMapValue(); if (nvs != null && nvs.size() > 0) { for (NamedValue nv : nvs) { if (nv != null) { add(document, nv.getName(), nv.getValue(), opts); add(document, "has_key", nv.getName(), opts); add(document, "annotation", nv.getValue(), opts); add(document, "annotation", nv.getName(), opts); } } } }
public ome.model.annotations.MapAnnotation newInstance() { return new ome.model.annotations.MapAnnotation(); }