@Override protected Void caseJCollectionField(JCollectionField field) { if (field.getElementField() instanceof JReferenceField) iterables.add(Iterables.filter(field.getValue(jobj), JObject.class)); return null; }
@Override public io.permazen.annotation.JSetField getDeclaringAnnotation() { return (io.permazen.annotation.JSetField)super.getDeclaringAnnotation(); }
@Override protected Component caseJCollectionField(JCollectionField field) { return ObjFieldPropertyDef.this.handleCollectionField(field.getValue(jobj)); }
return; objCollection = this.createPojoCollection(objSetter.getParameterTypes()[0]); final Collection<?> coreCollection = this.readCoreCollection(context.getTransaction().getTransaction(), id);
@Override SetSchemaField toSchemaItem(Permazen jdb) { final SetSchemaField schemaField = new SetSchemaField(); super.initialize(jdb, schemaField); return schemaField; }
@Override protected Void caseJCollectionField(JCollectionField field) { if (field.getElementField() instanceof JReferenceField) this.caseJReferenceField((JReferenceField)field.getElementField()); return null; }
abstract <T, E> void addChangeParameterTypes(List<TypeToken<?>> types, Class<T> targetType, TypeToken<E> elementType);
@Override public TypeToken<?> getTypeToken() { return this.buildTypeToken(this.elementField.getTypeToken().wrap()); }
@Override @SuppressWarnings("unchecked") void importPlain(ImportContext context, Object obj, ObjId id) { // Get POJO collection final Collection<?> objCollection; try { objCollection = (Collection<?>)obj.getClass().getMethod(this.getter.getName()).invoke(obj); } catch (Exception e) { return; } if (objCollection == null) return; // Get JCollectionField collection final Collection<Object> coreCollection = (Collection<Object>)this.readCoreCollection( context.getTransaction().getTransaction(), id); // Copy values over coreCollection.clear(); for (Object value : objCollection) coreCollection.add(this.elementField.importCoreValue(context, value)); }
@Override ListSchemaField toSchemaItem(Permazen jdb) { final ListSchemaField schemaField = new ListSchemaField(); super.initialize(jdb, schemaField); return schemaField; }
@Override public io.permazen.annotation.JListField getDeclaringAnnotation() { return (io.permazen.annotation.JListField)super.getDeclaringAnnotation(); }