All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.yoj.databind.schema.ObjectSchema Maven / Gradle / Ivy

Go to download

Core data-binding logic used by YOJ (YDB ORM for Java) to convert between Java objects and database rows (or anything representable by a Java Map, really).

The newest version!
package tech.ydb.yoj.databind.schema;

import tech.ydb.yoj.databind.schema.configuration.SchemaRegistry;
import tech.ydb.yoj.databind.schema.configuration.SchemaRegistry.SchemaKey;
import tech.ydb.yoj.databind.schema.reflect.Reflector;

public final class ObjectSchema extends Schema {
    private ObjectSchema(SchemaKey key, Reflector reflector) {
        super(key, reflector);
    }

    public static  ObjectSchema of(Class type) {
        return of(SchemaRegistry.getDefault(), type);
    }

    public static  ObjectSchema of(SchemaRegistry registry, Class type) {
        return registry.getOrCreate(ObjectSchema.class, ObjectSchema::new, SchemaKey.of(type));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy