예제 #1
0
 private List<RelDataType> toSql(List<RelDataType> types) {
   return Lists.transform(
       types,
       new com.google.common.base.Function<RelDataType, RelDataType>() {
         public RelDataType apply(RelDataType input) {
           if (input instanceof RelDataTypeFactoryImpl.JavaType
               && ((RelDataTypeFactoryImpl.JavaType) input).getJavaClass() == Object.class) {
             return typeFactory.createSqlType(SqlTypeName.ANY);
           }
           return typeFactory.toSql(input);
         }
       });
 }
예제 #2
0
  @Persist
  @SuppressWarnings("unused")
  private void beforeSerialization() {
    documentIds =
        Lists.transform(
            documents,
            new Function<Document, DocumentRefid>() {
              public DocumentRefid apply(Document document) {
                return new DocumentRefid(document.getId());
              }
            });

    // Remove score from attributes for serialization
    otherAttributesForSerialization = MapUtils.asHashMap(SimpleXmlWrappers.wrap(attributes));
    otherAttributesForSerialization.remove(SCORE);
    if (otherAttributesForSerialization.isEmpty()) {
      otherAttributesForSerialization = null;
    }
  }
예제 #3
0
 /** For JSON serialization only. */
 @JsonProperty("documents")
 @SuppressWarnings("unused")
 private List<Integer> getDocumentIds() {
   return Lists.transform(documents, Document.DocumentToId.INSTANCE);
 }