Package org.apache.isis.objectstore.sql.mapping

Examples of org.apache.isis.objectstore.sql.mapping.FieldMappingFactory


    private FieldMappingFactory referenceFieldMappingfactory;
    private ObjectReferenceMappingFactory objectReferenceMappingfactory;

    public FieldMapping createMapping(final ObjectSpecification object, final ObjectAssociation field) {
        final ObjectSpecification spec = field.getSpecification();
        FieldMappingFactory factory = fieldMappings.get(spec);
        if (factory != null) {
            return factory.createFieldMapping(object, field);
        } else if (spec.isEncodeable()) {
            factory = new JdbcGeneralValueMapper.Factory(Defaults.TYPE_DEFAULT());
            addFieldMappingFactory(spec, factory);
            return factory.createFieldMapping(object, field);
        } else {// if (true /* TODO test for reference */) {
            factory = referenceFieldMappingfactory;
            addFieldMappingFactory(spec, factory);
            return factory.createFieldMapping(object, field);
            // } else {
            // throw new IsisException("No mapper for " + spec +
            // " (no default mapper)");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.objectstore.sql.mapping.FieldMappingFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.