@SuppressWarnings("unchecked")
  public ResidentConverter(List<ObjectConverter.ColumnInfo> allColumns) throws java.io.IOException {
    Optional<ObjectConverter.ColumnInfo> column;

    final java.util.List<ObjectConverter.ColumnInfo> columns =
        allColumns
            .stream()
            .filter(
                it ->
                    "mixinReference".equals(it.typeSchema) && "Resident_entity".equals(it.typeName))
            .collect(Collectors.toList());
    columnCount = columns.size();

    readers = new ObjectConverter.Reader[columnCount];
    for (int i = 0; i < readers.length; i++) {
      readers[i] = (instance, rdr, ctx) -> StringConverter.skip(rdr, ctx);
    }

    final java.util.List<ObjectConverter.ColumnInfo> columnsExtended =
        allColumns
            .stream()
            .filter(
                it ->
                    "mixinReference".equals(it.typeSchema)
                        && "-ngs_Resident_type-".equals(it.typeName))
            .collect(Collectors.toList());
    columnCountExtended = columnsExtended.size();

    readersExtended = new ObjectConverter.Reader[columnCountExtended];
    for (int i = 0; i < readersExtended.length; i++) {
      readersExtended[i] = (instance, rdr, ctx) -> StringConverter.skip(rdr, ctx);
    }

    column = columns.stream().filter(it -> "id".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'id' column in mixinReference Resident_entity. Check if DB is in sync");
    __index___id = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "id".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'id' column in mixinReference Resident. Check if DB is in sync");
    __index__extended_id = (int) column.get().order - 1;

    column = columns.stream().filter(it -> "birth".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'birth' column in mixinReference Resident_entity. Check if DB is in sync");
    __index___birth = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "birth".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'birth' column in mixinReference Resident. Check if DB is in sync");
    __index__extended_birth = (int) column.get().order - 1;
  }
Exemple #2
0
  public static void __configureConverterExtended(
      org.revenj.postgres.ObjectConverter.Reader<Analysis>[] readers,
      int __index__extended_projectID,
      int __index__extended_articleID,
      int __index__extended_abc,
      int __index__extended_xyz,
      int __index__extended_clazz) {

    readers[__index__extended_projectID] =
        (item, reader, context) -> {
          item.projectID = org.revenj.postgres.converters.IntConverter.parse(reader);
          return item;
        };
    readers[__index__extended_articleID] =
        (item, reader, context) -> {
          item.articleID = org.revenj.postgres.converters.IntConverter.parse(reader);
          return item;
        };
    readers[__index__extended_abc] =
        (item, reader, context) -> {
          item.abc = org.revenj.postgres.converters.StringConverter.parse(reader, context, true);
          return item;
        };
    readers[__index__extended_xyz] =
        (item, reader, context) -> {
          item.xyz = org.revenj.postgres.converters.StringConverter.parse(reader, context, true);
          return item;
        };
    readers[__index__extended_clazz] =
        (item, reader, context) -> {
          item.clazz = org.revenj.postgres.converters.StringConverter.parse(reader, context, true);
          return item;
        };
  }
Exemple #3
0
  public static void __configureConverter(
      org.revenj.postgres.ObjectConverter.Reader<Clicked>[] readers,
      int __index____event_id,
      int __index___QueuedAt,
      int __index___ProcessedAt,
      int __index___date,
      int __index___number,
      int __index___bigint,
      int __index___bool,
      int __index___en) {

    readers[__index____event_id] =
        (item, reader, context) -> {
          item.URI = org.revenj.postgres.converters.StringConverter.parse(reader, context, false);
        };
    readers[__index___QueuedAt] =
        (item, reader, context) -> {
          item.QueuedAt =
              org.revenj.postgres.converters.TimestampConverter.parse(reader, context, false);
        };
    readers[__index___ProcessedAt] =
        (item, reader, context) -> {
          item.ProcessedAt =
              org.revenj.postgres.converters.TimestampConverter.parse(reader, context, true);
        };
    readers[__index___date] =
        (item, reader, context) -> {
          item.date = org.revenj.postgres.converters.DateConverter.parse(reader, true);
        };
    readers[__index___number] =
        (item, reader, context) -> {
          item.number = org.revenj.postgres.converters.DecimalConverter.parse(reader, false);
        };
    readers[__index___bigint] =
        (item, reader, context) -> {
          item.bigint = org.revenj.postgres.converters.LongConverter.parseNullable(reader);
        };
    readers[__index___bool] =
        (item, reader, context) -> {
          {
            java.util.List<Boolean> __list =
                org.revenj.postgres.converters.BoolConverter.parseCollection(
                    reader, context, false);
            if (__list != null) item.bool = new java.util.HashSet<Boolean>(__list);
            else item.bool = new java.util.HashSet<Boolean>(4);
          }
          ;
        };
    readers[__index___en] =
        (item, reader, context) -> {
          item.en = gen.model.test.converters.EnConverter.fromReader(reader);
        };
  }
Exemple #4
0
  @SuppressWarnings("unchecked")
  public Detail2Converter(List<ObjectConverter.ColumnInfo> allColumns) throws java.io.IOException {
    Optional<ObjectConverter.ColumnInfo> column;

    final java.util.List<ObjectConverter.ColumnInfo> columns =
        allColumns
            .stream()
            .filter(it -> "test".equals(it.typeSchema) && "Detail2_entity".equals(it.typeName))
            .collect(Collectors.toList());
    columnCount = columns.size();

    readers = new ObjectConverter.Reader[columnCount];
    for (int i = 0; i < readers.length; i++) {
      readers[i] =
          (instance, rdr, ctx) -> {
            StringConverter.skip(rdr, ctx);
            return instance;
          };
    }

    final java.util.List<ObjectConverter.ColumnInfo> columnsExtended =
        allColumns
            .stream()
            .filter(it -> "test".equals(it.typeSchema) && "-ngs_Detail2_type-".equals(it.typeName))
            .collect(Collectors.toList());
    columnCountExtended = columnsExtended.size();

    readersExtended = new ObjectConverter.Reader[columnCountExtended];
    for (int i = 0; i < readersExtended.length; i++) {
      readersExtended[i] =
          (instance, rdr, ctx) -> {
            StringConverter.skip(rdr, ctx);
            return instance;
          };
    }

    column = columns.stream().filter(it -> "u".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'u' column in test Detail2_entity. Check if DB is in sync");
    __index___u = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "u".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'u' column in test Detail2. Check if DB is in sync");
    __index__extended_u = (int) column.get().order - 1;

    column = columns.stream().filter(it -> "dd".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'dd' column in test Detail2_entity. Check if DB is in sync");
    __index___dd = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "dd".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'dd' column in test Detail2. Check if DB is in sync");
    __index__extended_dd = (int) column.get().order - 1;

    column = columns.stream().filter(it -> "EntityCompositeid".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'EntityCompositeid' column in test Detail2_entity. Check if DB is in sync");
    __index___EntityCompositeid = (int) column.get().order - 1;

    column =
        columnsExtended.stream().filter(it -> "EntityCompositeid".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'EntityCompositeid' column in test Detail2. Check if DB is in sync");
    __index__extended_EntityCompositeid = (int) column.get().order - 1;

    column = columns.stream().filter(it -> "EntityIndex".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'EntityIndex' column in test Detail2_entity. Check if DB is in sync");
    __index___EntityIndex = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "EntityIndex".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'EntityIndex' column in test Detail2. Check if DB is in sync");
    __index__extended_EntityIndex = (int) column.get().order - 1;

    column = columns.stream().filter(it -> "Index".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'Index' column in test Detail2_entity. Check if DB is in sync");
    __index___Index = (int) column.get().order - 1;

    column = columnsExtended.stream().filter(it -> "Index".equals(it.columnName)).findAny();
    if (!column.isPresent())
      throw new java.io.IOException(
          "Unable to find 'Index' column in test Detail2. Check if DB is in sync");
    __index__extended_Index = (int) column.get().order - 1;
  }