Package co.jirm.mapper.definition

Examples of co.jirm.mapper.definition.SqlParameterDefinition


     * Replace the complex objects with there ids.
     */
    for(SqlParameterDefinition pd : definition.getManyToOneParameters().values()) {
      if (pd.getObjectDefinition().isPresent()
          && pd.getObjectDefinition().get().getObjectDefintion().idParameter().isPresent()) {
        SqlParameterDefinition idDef =
            pd.getObjectDefinition().get().getObjectDefintion().idParameter().get();
        NestedKeyValue<Object> nkv =  ObjectMapUtils.getNestedKeyValue(m, pd.getParameterName(), idDef.getParameterName());
        if (nkv.isPresent()) {
          /*
           * TODO: We only set it if the object is actually present. ie do you really want to set null?
           */
          m.put(pd.getParameterName(), idDef.convertToSql(nkv.object));
        }
        else if (bulkInsert) {
          //TODO default annotation perhaps here?
          //http://stackoverflow.com/questions/197045/setting-default-values-for-columns-in-jpa
          m.put(pd.getParameterName(), null);
View Full Code Here

TOP

Related Classes of co.jirm.mapper.definition.SqlParameterDefinition

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.