private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new UserCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new Array1PojoCodec(new ObjectIdGenerator()), new Array1PojoFixedCodec(new ObjectIdGenerator()), new Array2PojoCodec(new ObjectIdGenerator()), new Array2PojoFixedCodec(new ObjectIdGenerator()), new Array3PojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new CharacterPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new StringPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new ShortPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new LongPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
@Override @SuppressWarnings("unchecked") public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) { if (clazz.equals(MonthPojo.class)) { return (Codec<T>) new MonthPojoCodec(registry, new ObjectIdGenerator()); } return null; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new AtomicBooleanPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new DatePojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new TransientPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new AtomicIntegerPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new BooleanPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
@Override @SuppressWarnings("unchecked") public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) { if (clazz.equals(Decimal128Pojo.class)) { return (Codec<T>) new Decimal128PojoCodec(new ObjectIdGenerator()); } return null; }
private MongoDatabase connect() { ObjectIdGenerator objectIdGenerator = new ObjectIdGenerator(); CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs( new UnknownIgnorePojoCodec(objectIdGenerator), new UnknownFailPojoCodec(objectIdGenerator))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
@Override @SuppressWarnings("unchecked") public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) { if (clazz.equals(YearPojo.class)) { return (Codec<T>) new YearPojoCodec(registry, new ObjectIdGenerator()); } return null; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new DoublePojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new FloatPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new EnumPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries.fromRegistries( MongoClient.getDefaultCodecRegistry(), CodecRegistries.fromCodecs(new BytePojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
@Override @SuppressWarnings("unchecked") public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) { if (clazz.equals(InstantPojo.class)) { return (Codec<T>) new InstantPojoCodec(registry, new ObjectIdGenerator()); } return null; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new AtomicLongPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
private MongoDatabase connect() { CodecRegistry codecRegistry = CodecRegistries .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries .fromCodecs(new IntegerPojoCodec(new ObjectIdGenerator()))); MongoDatabase db = getMongoClient().getDatabase("pojo") .withCodecRegistry(codecRegistry); return db; }
public PojoCodecProvider() { this(new ObjectIdGenerator()); }
public PojoCodecProvider(final ObjectIdGenerator objectIdGenerator) { this.objectIdGenerator = objectIdGenerator; }
public SimpleCodec(final ObjectIdGenerator objectIdGenerator) { this.objectIdGenerator = Assertions.notNull("objectIdGenerator", objectIdGenerator); }