private SqlParameterDefinition( SqlParameterConverter parameterConverter, String parameterName, String sqlName, Class<?> parameterType, int order, boolean id, boolean version, boolean generated, Optional<Enumerated> enumerated, Optional<SqlParameterObjectDefinition> objectDefinition) { super(); this.parameterName = check.notNull(parameterName, "parameterName"); this.sqlName = check.notNull(sqlName, "sqlName"); this.parameterType = check.notNull(parameterType, "parameterType"); this.order = order; this.id = id; this.version = version; this.enumerated = check.notNull(enumerated, "enumerated"); this.objectDefinition = check.notNull(objectDefinition, "objectDefinition"); this.parameterConverter = check.notNull(parameterConverter, "parameterConverter"); this.generated = generated; }
@Override public String load(String path) { try { String p = check.notNull(path, "path is null"); check.state(p.startsWith("/"), "path should start with '/' but was: {}", path); p = p.substring(1); return Resources.toString(Resources.getResource(p), Charsets.UTF_8); } catch (IOException e) { throw new RuntimeException(e); } } };
@Override public String load(String path) { try { String p = check.notNull(path, "path is null"); check.state(p.startsWith("/"), "path should start with '/' but was: {}", path); p = p.substring(1); return ResourceUtils.getClasspathResourceAsString(p); } catch (IOException e) { throw new RuntimeException(e); } } }
public static String parseFromPath(Class<?> k , final String path) { String resolved; resolved = "/" + check.notNull(ResourceUtils.resolvePath(k, path), "bug path failed: {}", path); return parseFromPath(resolved); }
protected String getColumnKey(SqlObjectDefinition<?> definition, ResultSetMetaData rsmd, int i) throws SQLException { String columnName = lookupColumnName(rsmd, i); return check.notNull(definition.resolveParameter(columnName).orNull(), "The column name or label: '{}' did not match any properties " + "for the object definition: {}", columnName, definition.getObjectType()) .getParameterName(); }
check.notNull(h, "Not Found: {}, Hash #{} not found in file: {}", p.getFullPath(), p.getHash().get(), p.getPathWithOutHash());
Enumerated anno = check.notNull(parameterDefinition.getEnumerated().orNull(), "Required @Enumerated annotation for enum arguments: {}", parameterDefinition.getParameterName());