public Item() { this.itemType = getItemType(this.getClass()); if (itemType == null) { logger.error("Item implementations must provide a public String constant named ITEM_TYPE to uniquely identify this Item for the persistence service."); } }
@Override public Item deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { ObjectCodec codec = jp.getCodec(); ObjectNode treeNode = codec.readTree(jp); String type = treeNode.get("itemType").textValue(); Class<? extends Item> objectClass = classes.get(type); if (objectClass == null) { objectClass = CustomItem.class; } else { treeNode.remove("itemType"); } Item item = codec.treeToValue(treeNode, objectClass); item.setItemId(treeNode.get("itemId").asText()); return item; } }
condition.setParameter("propertyValue", event.getTarget().getItemId()); condition.setParameter("comparisonOperator", "equals"); conditions.add(condition); condition.setParameter("propertyValue", event.getTarget().getItemType()); condition.setParameter("comparisonOperator", "equals"); conditions.add(condition);
profileCondition.setParameter("propertyName", "profileId"); profileCondition.setParameter("comparisonOperator", "equals"); profileCondition.setParameter("propertyValue", item.getItemId()); l.add(profileCondition);
condition.setParameter("propertyValue", event.getTarget().getItemId()); condition.setParameter("comparisonOperator", "equals"); conditions.add(condition); condition.setParameter("propertyValue", event.getTarget().getItemType()); condition.setParameter("comparisonOperator", "equals"); conditions.add(condition);
public Item() { this.itemType = getItemType(this.getClass()); if (itemType == null) { logger.error("Item implementations must provide a public String constant named ITEM_TYPE to uniquely identify this Item for the persistence service."); } }
@Override public Item deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { ObjectCodec codec = jp.getCodec(); ObjectNode treeNode = codec.readTree(jp); String type = treeNode.get("itemType").textValue(); Class<? extends Item> objectClass = classes.get(type); if (objectClass == null) { objectClass = CustomItem.class; } else { treeNode.remove("itemType"); } Item item = codec.treeToValue(treeNode, objectClass); item.setItemId(treeNode.get("itemId").asText()); return item; } }