repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/Where.java
Where.raw
public Where<T, ID> raw(String rawStatement, ArgumentHolder... args) { for (ArgumentHolder arg : args) { String columnName = arg.getColumnName(); if (columnName == null) { if (arg.getSqlType() == null) { throw new IllegalArgumentException("Either the column name or SqlType must be set on each argument"...
java
public Where<T, ID> raw(String rawStatement, ArgumentHolder... args) { for (ArgumentHolder arg : args) { String columnName = arg.getColumnName(); if (columnName == null) { if (arg.getSqlType() == null) { throw new IllegalArgumentException("Either the column name or SqlType must be set on each argument"...
[ "public", "Where", "<", "T", ",", "ID", ">", "raw", "(", "String", "rawStatement", ",", "ArgumentHolder", "...", "args", ")", "{", "for", "(", "ArgumentHolder", "arg", ":", "args", ")", "{", "String", "columnName", "=", "arg", ".", "getColumnName", "(", ...
Add a raw statement as part of the where that can be anything that the database supports. Using more structured methods is recommended but this gives more control over the query and allows you to utilize database specific features. @param rawStatement The statement that we should insert into the WHERE. @param args Op...
[ "Add", "a", "raw", "statement", "as", "part", "of", "the", "where", "that", "can", "be", "anything", "that", "the", "database", "supports", ".", "Using", "more", "structured", "methods", "is", "recommended", "but", "this", "gives", "more", "control", "over",...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L445-L458
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/Where.java
Where.rawComparison
public Where<T, ID> rawComparison(String columnName, String rawOperator, Object value) throws SQLException { addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value, rawOperator)); return this; }
java
public Where<T, ID> rawComparison(String columnName, String rawOperator, Object value) throws SQLException { addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value, rawOperator)); return this; }
[ "public", "Where", "<", "T", ",", "ID", ">", "rawComparison", "(", "String", "columnName", ",", "String", "rawOperator", ",", "Object", "value", ")", "throws", "SQLException", "{", "addClause", "(", "new", "SimpleComparison", "(", "columnName", ",", "findColum...
Make a comparison where the operator is specified by the caller. It is up to the caller to specify an appropriate operator for the database and that it be formatted correctly.
[ "Make", "a", "comparison", "where", "the", "operator", "is", "specified", "by", "the", "caller", ".", "It", "is", "up", "to", "the", "caller", "to", "specify", "an", "appropriate", "operator", "for", "the", "database", "and", "that", "it", "be", "formatted...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L464-L467
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/Where.java
Where.reset
public Where<T, ID> reset() { for (int i = 0; i < clauseStackLevel; i++) { // help with gc clauseStack[i] = null; } clauseStackLevel = 0; return this; }
java
public Where<T, ID> reset() { for (int i = 0; i < clauseStackLevel; i++) { // help with gc clauseStack[i] = null; } clauseStackLevel = 0; return this; }
[ "public", "Where", "<", "T", ",", "ID", ">", "reset", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "clauseStackLevel", ";", "i", "++", ")", "{", "// help with gc", "clauseStack", "[", "i", "]", "=", "null", ";", "}", "clauseSta...
Reset the Where object so it can be re-used.
[ "Reset", "the", "Where", "object", "so", "it", "can", "be", "re", "-", "used", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L521-L528
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/Where.java
Where.getStatement
public String getStatement() throws SQLException { StringBuilder sb = new StringBuilder(); appendSql(null, sb, new ArrayList<ArgumentHolder>()); return sb.toString(); }
java
public String getStatement() throws SQLException { StringBuilder sb = new StringBuilder(); appendSql(null, sb, new ArrayList<ArgumentHolder>()); return sb.toString(); }
[ "public", "String", "getStatement", "(", ")", "throws", "SQLException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "appendSql", "(", "null", ",", "sb", ",", "new", "ArrayList", "<", "ArgumentHolder", ">", "(", ")", ")", ";", ...
Returns the associated SQL WHERE statement.
[ "Returns", "the", "associated", "SQL", "WHERE", "statement", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L533-L537
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedUpdateId.java
MappedUpdateId.execute
public int execute(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { try { // the arguments are the new-id and old-id Object[] args = new Object[] { convertIdToFieldObject(newId), extractIdToFieldObject(data) }; int rowC = databaseConnection.update(sta...
java
public int execute(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { try { // the arguments are the new-id and old-id Object[] args = new Object[] { convertIdToFieldObject(newId), extractIdToFieldObject(data) }; int rowC = databaseConnection.update(sta...
[ "public", "int", "execute", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ID", "newId", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "try", "{", "// the arguments are the new-id and old-id", "Object", "[", "]", "a...
Update the id field of the object in the database.
[ "Update", "the", "id", "field", "of", "the", "object", "in", "the", "database", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedUpdateId.java#L27-L54
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfigLoader.java
DatabaseFieldConfigLoader.fromReader
public static DatabaseFieldConfig fromReader(BufferedReader reader) throws SQLException { DatabaseFieldConfig config = new DatabaseFieldConfig(); boolean anything = false; while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.create("Could no...
java
public static DatabaseFieldConfig fromReader(BufferedReader reader) throws SQLException { DatabaseFieldConfig config = new DatabaseFieldConfig(); boolean anything = false; while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.create("Could no...
[ "public", "static", "DatabaseFieldConfig", "fromReader", "(", "BufferedReader", "reader", ")", "throws", "SQLException", "{", "DatabaseFieldConfig", "config", "=", "new", "DatabaseFieldConfig", "(", ")", ";", "boolean", "anything", "=", "false", ";", "while", "(", ...
Load a configuration in from a text file. @return A config if any of the fields were set otherwise null on EOF.
[ "Load", "a", "configuration", "in", "from", "a", "text", "file", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfigLoader.java#L30-L65
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfigLoader.java
DatabaseFieldConfigLoader.write
public static void write(BufferedWriter writer, DatabaseFieldConfig config, String tableName) throws SQLException { try { writeConfig(writer, config, tableName); } catch (IOException e) { throw SqlExceptionUtil.create("Could not write config to writer", e); } }
java
public static void write(BufferedWriter writer, DatabaseFieldConfig config, String tableName) throws SQLException { try { writeConfig(writer, config, tableName); } catch (IOException e) { throw SqlExceptionUtil.create("Could not write config to writer", e); } }
[ "public", "static", "void", "write", "(", "BufferedWriter", "writer", ",", "DatabaseFieldConfig", "config", ",", "String", "tableName", ")", "throws", "SQLException", "{", "try", "{", "writeConfig", "(", "writer", ",", "config", ",", "tableName", ")", ";", "}"...
Write the configuration to a buffered writer.
[ "Write", "the", "configuration", "to", "a", "buffered", "writer", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfigLoader.java#L70-L76
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java
UpdateBuilder.updateColumnValue
public UpdateBuilder<T, ID> updateColumnValue(String columnName, Object value) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(columnName, ne...
java
public UpdateBuilder<T, ID> updateColumnValue(String columnName, Object value) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(columnName, ne...
[ "public", "UpdateBuilder", "<", "T", ",", "ID", ">", "updateColumnValue", "(", "String", "columnName", ",", "Object", "value", ")", "throws", "SQLException", "{", "FieldType", "fieldType", "=", "verifyColumnName", "(", "columnName", ")", ";", "if", "(", "field...
Add a column to be set to a value for UPDATE statements. This will generate something like columnName = 'value' with the value escaped if necessary.
[ "Add", "a", "column", "to", "be", "set", "to", "a", "value", "for", "UPDATE", "statements", ".", "This", "will", "generate", "something", "like", "columnName", "=", "value", "with", "the", "value", "escaped", "if", "necessary", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java#L46-L53
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java
UpdateBuilder.updateColumnExpression
public UpdateBuilder<T, ID> updateColumnExpression(String columnName, String expression) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(colu...
java
public UpdateBuilder<T, ID> updateColumnExpression(String columnName, String expression) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(colu...
[ "public", "UpdateBuilder", "<", "T", ",", "ID", ">", "updateColumnExpression", "(", "String", "columnName", ",", "String", "expression", ")", "throws", "SQLException", "{", "FieldType", "fieldType", "=", "verifyColumnName", "(", "columnName", ")", ";", "if", "("...
Add a column to be set to a value for UPDATE statements. This will generate something like 'columnName = expression' where the expression is built by the caller. <p> The expression should have any strings escaped using the {@link #escapeValue(String)} or {@link #escapeValue(StringBuilder, String)} methods and should h...
[ "Add", "a", "column", "to", "be", "set", "to", "a", "value", "for", "UPDATE", "statements", ".", "This", "will", "generate", "something", "like", "columnName", "=", "expression", "where", "the", "expression", "is", "built", "by", "the", "caller", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java#L65-L72
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java
DatabaseTableConfig.initialize
public void initialize() { if (dataClass == null) { throw new IllegalStateException("dataClass was never set on " + getClass().getSimpleName()); } if (tableName == null) { tableName = extractTableName(databaseType, dataClass); } }
java
public void initialize() { if (dataClass == null) { throw new IllegalStateException("dataClass was never set on " + getClass().getSimpleName()); } if (tableName == null) { tableName = extractTableName(databaseType, dataClass); } }
[ "public", "void", "initialize", "(", ")", "{", "if", "(", "dataClass", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"dataClass was never set on \"", "+", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", "}", "if", ...
Initialize the class if this is being called with Spring.
[ "Initialize", "the", "class", "if", "this", "is", "being", "called", "with", "Spring", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java#L80-L87
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java
DatabaseTableConfig.extractFieldTypes
public void extractFieldTypes(DatabaseType databaseType) throws SQLException { if (fieldTypes == null) { if (fieldConfigs == null) { fieldTypes = extractFieldTypes(databaseType, dataClass, tableName); } else { fieldTypes = convertFieldConfigs(databaseType, tableName, fieldConfigs); } } }
java
public void extractFieldTypes(DatabaseType databaseType) throws SQLException { if (fieldTypes == null) { if (fieldConfigs == null) { fieldTypes = extractFieldTypes(databaseType, dataClass, tableName); } else { fieldTypes = convertFieldConfigs(databaseType, tableName, fieldConfigs); } } }
[ "public", "void", "extractFieldTypes", "(", "DatabaseType", "databaseType", ")", "throws", "SQLException", "{", "if", "(", "fieldTypes", "==", "null", ")", "{", "if", "(", "fieldConfigs", "==", "null", ")", "{", "fieldTypes", "=", "extractFieldTypes", "(", "da...
Extract the field types from the fieldConfigs if they have not already been configured.
[ "Extract", "the", "field", "types", "from", "the", "fieldConfigs", "if", "they", "have", "not", "already", "been", "configured", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java#L123-L131
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java
DatabaseTableConfig.fromClass
public static <T> DatabaseTableConfig<T> fromClass(DatabaseType databaseType, Class<T> clazz) throws SQLException { String tableName = extractTableName(databaseType, clazz); if (databaseType.isEntityNamesMustBeUpCase()) { tableName = databaseType.upCaseEntityName(tableName); } return new DatabaseTableConfig<...
java
public static <T> DatabaseTableConfig<T> fromClass(DatabaseType databaseType, Class<T> clazz) throws SQLException { String tableName = extractTableName(databaseType, clazz); if (databaseType.isEntityNamesMustBeUpCase()) { tableName = databaseType.upCaseEntityName(tableName); } return new DatabaseTableConfig<...
[ "public", "static", "<", "T", ">", "DatabaseTableConfig", "<", "T", ">", "fromClass", "(", "DatabaseType", "databaseType", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "SQLException", "{", "String", "tableName", "=", "extractTableName", "(", "databaseT...
Extract the DatabaseTableConfig for a particular class by looking for class and field annotations. This is used by internal classes to configure a class.
[ "Extract", "the", "DatabaseTableConfig", "for", "a", "particular", "class", "by", "looking", "for", "class", "and", "field", "annotations", ".", "This", "is", "used", "by", "internal", "classes", "to", "configure", "a", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java#L167-L174
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java
DatabaseTableConfig.extractTableName
public static <T> String extractTableName(DatabaseType databaseType, Class<T> clazz) { DatabaseTable databaseTable = clazz.getAnnotation(DatabaseTable.class); String name = null; if (databaseTable != null && databaseTable.tableName() != null && databaseTable.tableName().length() > 0) { name = databaseTable.tab...
java
public static <T> String extractTableName(DatabaseType databaseType, Class<T> clazz) { DatabaseTable databaseTable = clazz.getAnnotation(DatabaseTable.class); String name = null; if (databaseTable != null && databaseTable.tableName() != null && databaseTable.tableName().length() > 0) { name = databaseTable.tab...
[ "public", "static", "<", "T", ">", "String", "extractTableName", "(", "DatabaseType", "databaseType", ",", "Class", "<", "T", ">", "clazz", ")", "{", "DatabaseTable", "databaseTable", "=", "clazz", ".", "getAnnotation", "(", "DatabaseTable", ".", "class", ")",...
Extract and return the table name for a class.
[ "Extract", "and", "return", "the", "table", "name", "for", "a", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfig.java#L179-L198
train
j256/ormlite-core
src/main/java/com/j256/ormlite/logger/LocalLog.java
LocalLog.openLogFile
public static void openLogFile(String logPath) { if (logPath == null) { printStream = System.out; } else { try { printStream = new PrintStream(new File(logPath)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("Log file " + logPath + " was not found", e); } } }
java
public static void openLogFile(String logPath) { if (logPath == null) { printStream = System.out; } else { try { printStream = new PrintStream(new File(logPath)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("Log file " + logPath + " was not found", e); } } }
[ "public", "static", "void", "openLogFile", "(", "String", "logPath", ")", "{", "if", "(", "logPath", "==", "null", ")", "{", "printStream", "=", "System", ".", "out", ";", "}", "else", "{", "try", "{", "printStream", "=", "new", "PrintStream", "(", "ne...
Reopen the associated static logging stream. Set to null to redirect to System.out.
[ "Reopen", "the", "associated", "static", "logging", "stream", ".", "Set", "to", "null", "to", "redirect", "to", "System", ".", "out", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/logger/LocalLog.java#L120-L130
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.queryForCountStar
public long queryForCountStar(DatabaseConnection databaseConnection) throws SQLException { if (countStarQuery == null) { StringBuilder sb = new StringBuilder(64); sb.append("SELECT COUNT(*) FROM "); databaseType.appendEscapedEntityName(sb, tableInfo.getTableName()); countStarQuery = sb.toString(); } l...
java
public long queryForCountStar(DatabaseConnection databaseConnection) throws SQLException { if (countStarQuery == null) { StringBuilder sb = new StringBuilder(64); sb.append("SELECT COUNT(*) FROM "); databaseType.appendEscapedEntityName(sb, tableInfo.getTableName()); countStarQuery = sb.toString(); } l...
[ "public", "long", "queryForCountStar", "(", "DatabaseConnection", "databaseConnection", ")", "throws", "SQLException", "{", "if", "(", "countStarQuery", "==", "null", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "64", ")", ";", "sb", ".", ...
Return a long value which is the number of rows in the table.
[ "Return", "a", "long", "value", "which", "is", "the", "number", "of", "rows", "in", "the", "table", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L132-L142
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.queryForLong
public long queryForLong(DatabaseConnection databaseConnection, PreparedStmt<T> preparedStmt) throws SQLException { CompiledStatement compiledStatement = preparedStmt.compile(databaseConnection, StatementType.SELECT_LONG); DatabaseResults results = null; try { results = compiledStatement.runQuery(null); if ...
java
public long queryForLong(DatabaseConnection databaseConnection, PreparedStmt<T> preparedStmt) throws SQLException { CompiledStatement compiledStatement = preparedStmt.compile(databaseConnection, StatementType.SELECT_LONG); DatabaseResults results = null; try { results = compiledStatement.runQuery(null); if ...
[ "public", "long", "queryForLong", "(", "DatabaseConnection", "databaseConnection", ",", "PreparedStmt", "<", "T", ">", "preparedStmt", ")", "throws", "SQLException", "{", "CompiledStatement", "compiledStatement", "=", "preparedStmt", ".", "compile", "(", "databaseConnec...
Return a long value from a prepared query.
[ "Return", "a", "long", "value", "from", "a", "prepared", "query", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L147-L161
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.buildIterator
public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource, int resultFlags, ObjectCache objectCache) throws SQLException { prepareQueryForAll(); return buildIterator(classDao, connectionSource, preparedQueryForAll, objectCache, resultFlags); }
java
public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource, int resultFlags, ObjectCache objectCache) throws SQLException { prepareQueryForAll(); return buildIterator(classDao, connectionSource, preparedQueryForAll, objectCache, resultFlags); }
[ "public", "SelectIterator", "<", "T", ",", "ID", ">", "buildIterator", "(", "BaseDaoImpl", "<", "T", ",", "ID", ">", "classDao", ",", "ConnectionSource", "connectionSource", ",", "int", "resultFlags", ",", "ObjectCache", "objectCache", ")", "throws", "SQLExcepti...
Create and return a SelectIterator for the class using the default mapped query for all statement.
[ "Create", "and", "return", "a", "SelectIterator", "for", "the", "class", "using", "the", "default", "mapped", "query", "for", "all", "statement", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L214-L218
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.updateRaw
public int updateRaw(DatabaseConnection connection, String statement, String[] arguments) throws SQLException { logger.debug("running raw update statement: {}", statement); if (arguments.length > 0) { // need to do the (Object) cast to force args to be a single object logger.trace("update arguments: {}", (Obj...
java
public int updateRaw(DatabaseConnection connection, String statement, String[] arguments) throws SQLException { logger.debug("running raw update statement: {}", statement); if (arguments.length > 0) { // need to do the (Object) cast to force args to be a single object logger.trace("update arguments: {}", (Obj...
[ "public", "int", "updateRaw", "(", "DatabaseConnection", "connection", ",", "String", "statement", ",", "String", "[", "]", "arguments", ")", "throws", "SQLException", "{", "logger", ".", "debug", "(", "\"running raw update statement: {}\"", ",", "statement", ")", ...
Return the number of rows affected.
[ "Return", "the", "number", "of", "rows", "affected", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L408-L422
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.create
public int create(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedInsert == null) { mappedInsert = MappedCreate.build(dao, tableInfo); } int result = mappedInsert.insert(databaseType, databaseConnection, data, objectCache); if (dao != null && !localIsIn...
java
public int create(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedInsert == null) { mappedInsert = MappedCreate.build(dao, tableInfo); } int result = mappedInsert.insert(databaseType, databaseConnection, data, objectCache); if (dao != null && !localIsIn...
[ "public", "int", "create", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedInsert", "==", "null", ")", "{", "mappedInsert", "=", "MappedCreate", ".", "bui...
Create a new entry in the database from an object.
[ "Create", "a", "new", "entry", "in", "the", "database", "from", "an", "object", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L454-L463
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.updateId
public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { if (mappedUpdateId == null) { mappedUpdateId = MappedUpdateId.build(dao, tableInfo); } int result = mappedUpdateId.execute(databaseConnection, data, newId, objectCache); if (dao != n...
java
public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { if (mappedUpdateId == null) { mappedUpdateId = MappedUpdateId.build(dao, tableInfo); } int result = mappedUpdateId.execute(databaseConnection, data, newId, objectCache); if (dao != n...
[ "public", "int", "updateId", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ID", "newId", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedUpdateId", "==", "null", ")", "{", "mappedUpdateId", "=",...
Update an object in the database to change its id to the newId parameter.
[ "Update", "an", "object", "in", "the", "database", "to", "change", "its", "id", "to", "the", "newId", "parameter", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L482-L492
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.update
public int update(DatabaseConnection databaseConnection, PreparedUpdate<T> preparedUpdate) throws SQLException { CompiledStatement compiledStatement = preparedUpdate.compile(databaseConnection, StatementType.UPDATE); try { int result = compiledStatement.runUpdate(); if (dao != null && !localIsInBatchMode.get(...
java
public int update(DatabaseConnection databaseConnection, PreparedUpdate<T> preparedUpdate) throws SQLException { CompiledStatement compiledStatement = preparedUpdate.compile(databaseConnection, StatementType.UPDATE); try { int result = compiledStatement.runUpdate(); if (dao != null && !localIsInBatchMode.get(...
[ "public", "int", "update", "(", "DatabaseConnection", "databaseConnection", ",", "PreparedUpdate", "<", "T", ">", "preparedUpdate", ")", "throws", "SQLException", "{", "CompiledStatement", "compiledStatement", "=", "preparedUpdate", ".", "compile", "(", "databaseConnect...
Update rows in the database.
[ "Update", "rows", "in", "the", "database", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L497-L508
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.refresh
public int refresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedRefresh == null) { mappedRefresh = MappedRefresh.build(dao, tableInfo); } return mappedRefresh.executeRefresh(databaseConnection, data, objectCache); }
java
public int refresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedRefresh == null) { mappedRefresh = MappedRefresh.build(dao, tableInfo); } return mappedRefresh.executeRefresh(databaseConnection, data, objectCache); }
[ "public", "int", "refresh", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedRefresh", "==", "null", ")", "{", "mappedRefresh", "=", "MappedRefresh", ".", ...
Does a query for the object's Id and copies in each of the field values from the database to refresh the data parameter.
[ "Does", "a", "query", "for", "the", "object", "s", "Id", "and", "copies", "in", "each", "of", "the", "field", "values", "from", "the", "database", "to", "refresh", "the", "data", "parameter", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L514-L519
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.delete
public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedDelete == null) { mappedDelete = MappedDelete.build(dao, tableInfo); } int result = mappedDelete.delete(databaseConnection, data, objectCache); if (dao != null && !localIsInBatchMode.get(...
java
public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { if (mappedDelete == null) { mappedDelete = MappedDelete.build(dao, tableInfo); } int result = mappedDelete.delete(databaseConnection, data, objectCache); if (dao != null && !localIsInBatchMode.get(...
[ "public", "int", "delete", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedDelete", "==", "null", ")", "{", "mappedDelete", "=", "MappedDelete", ".", "bui...
Delete an object from the database.
[ "Delete", "an", "object", "from", "the", "database", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L524-L533
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.deleteById
public int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException { if (mappedDelete == null) { mappedDelete = MappedDelete.build(dao, tableInfo); } int result = mappedDelete.deleteById(databaseConnection, id, objectCache); if (dao != null && !localIsInBatchMode...
java
public int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException { if (mappedDelete == null) { mappedDelete = MappedDelete.build(dao, tableInfo); } int result = mappedDelete.deleteById(databaseConnection, id, objectCache); if (dao != null && !localIsInBatchMode...
[ "public", "int", "deleteById", "(", "DatabaseConnection", "databaseConnection", ",", "ID", "id", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedDelete", "==", "null", ")", "{", "mappedDelete", "=", "MappedDelete", ".", "...
Delete an object from the database by id.
[ "Delete", "an", "object", "from", "the", "database", "by", "id", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L538-L547
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.delete
public int delete(DatabaseConnection databaseConnection, PreparedDelete<T> preparedDelete) throws SQLException { CompiledStatement compiledStatement = preparedDelete.compile(databaseConnection, StatementType.DELETE); try { int result = compiledStatement.runUpdate(); if (dao != null && !localIsInBatchMode.get(...
java
public int delete(DatabaseConnection databaseConnection, PreparedDelete<T> preparedDelete) throws SQLException { CompiledStatement compiledStatement = preparedDelete.compile(databaseConnection, StatementType.DELETE); try { int result = compiledStatement.runUpdate(); if (dao != null && !localIsInBatchMode.get(...
[ "public", "int", "delete", "(", "DatabaseConnection", "databaseConnection", ",", "PreparedDelete", "<", "T", ">", "preparedDelete", ")", "throws", "SQLException", "{", "CompiledStatement", "compiledStatement", "=", "preparedDelete", ".", "compile", "(", "databaseConnect...
Delete rows that match the prepared statement.
[ "Delete", "rows", "that", "match", "the", "prepared", "statement", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L578-L589
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.callBatchTasks
public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException { if (connectionSource.isSingleConnection(tableInfo.getTableName())) { synchronized (this) { return doCallBatchTasks(connectionSource, callable); } } else { return doCallBatchTasks(connectionSour...
java
public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException { if (connectionSource.isSingleConnection(tableInfo.getTableName())) { synchronized (this) { return doCallBatchTasks(connectionSource, callable); } } else { return doCallBatchTasks(connectionSour...
[ "public", "<", "CT", ">", "CT", "callBatchTasks", "(", "ConnectionSource", "connectionSource", ",", "Callable", "<", "CT", ">", "callable", ")", "throws", "SQLException", "{", "if", "(", "connectionSource", ".", "isSingleConnection", "(", "tableInfo", ".", "getT...
Call batch tasks inside of a connection which may, or may not, have been "saved".
[ "Call", "batch", "tasks", "inside", "of", "a", "connection", "which", "may", "or", "may", "not", "have", "been", "saved", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L594-L602
train
j256/ormlite-core
src/main/java/com/j256/ormlite/misc/SqlExceptionUtil.java
SqlExceptionUtil.create
public static SQLException create(String message, Throwable cause) { SQLException sqlException; if (cause instanceof SQLException) { // if the cause is another SQLException, pass alot of the SQL state sqlException = new SQLException(message, ((SQLException) cause).getSQLState()); } else { sqlException = ...
java
public static SQLException create(String message, Throwable cause) { SQLException sqlException; if (cause instanceof SQLException) { // if the cause is another SQLException, pass alot of the SQL state sqlException = new SQLException(message, ((SQLException) cause).getSQLState()); } else { sqlException = ...
[ "public", "static", "SQLException", "create", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "SQLException", "sqlException", ";", "if", "(", "cause", "instanceof", "SQLException", ")", "{", "// if the cause is another SQLException, pass alot of the SQL sta...
Convenience method to allow a cause. Grrrr.
[ "Convenience", "method", "to", "allow", "a", "cause", ".", "Grrrr", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/SqlExceptionUtil.java#L21-L31
train
j256/ormlite-core
src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
BaseDaoImpl.initialize
public void initialize() throws SQLException { if (initialized) { // just skip it if already initialized return; } if (connectionSource == null) { throw new IllegalStateException("connectionSource was never set on " + getClass().getSimpleName()); } databaseType = connectionSource.getDatabaseType();...
java
public void initialize() throws SQLException { if (initialized) { // just skip it if already initialized return; } if (connectionSource == null) { throw new IllegalStateException("connectionSource was never set on " + getClass().getSimpleName()); } databaseType = connectionSource.getDatabaseType();...
[ "public", "void", "initialize", "(", ")", "throws", "SQLException", "{", "if", "(", "initialized", ")", "{", "// just skip it if already initialized", "return", ";", "}", "if", "(", "connectionSource", "==", "null", ")", "{", "throw", "new", "IllegalStateException...
Initialize the various DAO configurations after the various setters have been called.
[ "Initialize", "the", "various", "DAO", "configurations", "after", "the", "various", "setters", "have", "been", "called", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java#L143-L225
train
j256/ormlite-core
src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
BaseDaoImpl.createDao
static <T, ID> Dao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz) throws SQLException { return new BaseDaoImpl<T, ID>(connectionSource, clazz) { }; }
java
static <T, ID> Dao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz) throws SQLException { return new BaseDaoImpl<T, ID>(connectionSource, clazz) { }; }
[ "static", "<", "T", ",", "ID", ">", "Dao", "<", "T", ",", "ID", ">", "createDao", "(", "ConnectionSource", "connectionSource", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "SQLException", "{", "return", "new", "BaseDaoImpl", "<", "T", ",", "ID"...
Helper method to create a Dao object without having to define a class. Dao classes are supposed to be convenient but if you have a lot of classes, they can seem to be a pain. <p> <b>NOTE:</b> You should use {@link DaoManager#createDao(ConnectionSource, DatabaseTableConfig)} instead of this method so you won't have to ...
[ "Helper", "method", "to", "create", "a", "Dao", "object", "without", "having", "to", "define", "a", "class", ".", "Dao", "classes", "are", "supposed", "to", "be", "convenient", "but", "if", "you", "have", "a", "lot", "of", "classes", "they", "can", "seem...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java#L1059-L1062
train
j256/ormlite-core
src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
BaseDaoImpl.findNoArgConstructor
private Constructor<T> findNoArgConstructor(Class<T> dataClass) { Constructor<T>[] constructors; try { @SuppressWarnings("unchecked") Constructor<T>[] consts = (Constructor<T>[]) dataClass.getDeclaredConstructors(); // i do this [grossness] to be able to move the Suppress inside the method constructors ...
java
private Constructor<T> findNoArgConstructor(Class<T> dataClass) { Constructor<T>[] constructors; try { @SuppressWarnings("unchecked") Constructor<T>[] consts = (Constructor<T>[]) dataClass.getDeclaredConstructors(); // i do this [grossness] to be able to move the Suppress inside the method constructors ...
[ "private", "Constructor", "<", "T", ">", "findNoArgConstructor", "(", "Class", "<", "T", ">", "dataClass", ")", "{", "Constructor", "<", "T", ">", "[", "]", "constructors", ";", "try", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Constructor", ...
Locate the no arg constructor for the class.
[ "Locate", "the", "no", "arg", "constructor", "for", "the", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java#L1176-L1204
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java
DatabaseFieldConfig.findGetMethod
public static Method findGetMethod(Field field, DatabaseType databaseType, boolean throwExceptions) throws IllegalArgumentException { Method fieldGetMethod = findMethodFromNames(field, true, throwExceptions, methodFromField(field, "get", databaseType, true), methodFromField(field, "get", databaseType, false), ...
java
public static Method findGetMethod(Field field, DatabaseType databaseType, boolean throwExceptions) throws IllegalArgumentException { Method fieldGetMethod = findMethodFromNames(field, true, throwExceptions, methodFromField(field, "get", databaseType, true), methodFromField(field, "get", databaseType, false), ...
[ "public", "static", "Method", "findGetMethod", "(", "Field", "field", ",", "DatabaseType", "databaseType", ",", "boolean", "throwExceptions", ")", "throws", "IllegalArgumentException", "{", "Method", "fieldGetMethod", "=", "findMethodFromNames", "(", "field", ",", "tr...
Find and return the appropriate getter method for field. @return Get method or null (or throws IllegalArgumentException) if none found.
[ "Find", "and", "return", "the", "appropriate", "getter", "method", "for", "field", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java#L546-L563
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java
DatabaseFieldConfig.findSetMethod
public static Method findSetMethod(Field field, DatabaseType databaseType, boolean throwExceptions) throws IllegalArgumentException { Method fieldSetMethod = findMethodFromNames(field, false, throwExceptions, methodFromField(field, "set", databaseType, true), methodFromField(field, "set", databaseType, false))...
java
public static Method findSetMethod(Field field, DatabaseType databaseType, boolean throwExceptions) throws IllegalArgumentException { Method fieldSetMethod = findMethodFromNames(field, false, throwExceptions, methodFromField(field, "set", databaseType, true), methodFromField(field, "set", databaseType, false))...
[ "public", "static", "Method", "findSetMethod", "(", "Field", "field", ",", "DatabaseType", "databaseType", ",", "boolean", "throwExceptions", ")", "throws", "IllegalArgumentException", "{", "Method", "fieldSetMethod", "=", "findMethodFromNames", "(", "field", ",", "fa...
Find and return the appropriate setter method for field. @return Set method or null (or throws IllegalArgumentException) if none found.
[ "Find", "and", "return", "the", "appropriate", "setter", "method", "for", "field", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java#L570-L586
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java
DatabaseFieldConfig.postProcess
public void postProcess() { if (foreignColumnName != null) { foreignAutoRefresh = true; } if (foreignAutoRefresh && maxForeignAutoRefreshLevel == NO_MAX_FOREIGN_AUTO_REFRESH_LEVEL_SPECIFIED) { maxForeignAutoRefreshLevel = DatabaseField.DEFAULT_MAX_FOREIGN_AUTO_REFRESH_LEVEL; } }
java
public void postProcess() { if (foreignColumnName != null) { foreignAutoRefresh = true; } if (foreignAutoRefresh && maxForeignAutoRefreshLevel == NO_MAX_FOREIGN_AUTO_REFRESH_LEVEL_SPECIFIED) { maxForeignAutoRefreshLevel = DatabaseField.DEFAULT_MAX_FOREIGN_AUTO_REFRESH_LEVEL; } }
[ "public", "void", "postProcess", "(", ")", "{", "if", "(", "foreignColumnName", "!=", "null", ")", "{", "foreignAutoRefresh", "=", "true", ";", "}", "if", "(", "foreignAutoRefresh", "&&", "maxForeignAutoRefreshLevel", "==", "NO_MAX_FOREIGN_AUTO_REFRESH_LEVEL_SPECIFIED...
Process the settings when we are going to consume them.
[ "Process", "the", "settings", "when", "we", "are", "going", "to", "consume", "them", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java#L642-L649
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java
DatabaseFieldConfig.findMatchingEnumVal
public static Enum<?> findMatchingEnumVal(Field field, String unknownEnumName) { if (unknownEnumName == null || unknownEnumName.length() == 0) { return null; } for (Enum<?> enumVal : (Enum<?>[]) field.getType().getEnumConstants()) { if (enumVal.name().equals(unknownEnumName)) { return enumVal; } } ...
java
public static Enum<?> findMatchingEnumVal(Field field, String unknownEnumName) { if (unknownEnumName == null || unknownEnumName.length() == 0) { return null; } for (Enum<?> enumVal : (Enum<?>[]) field.getType().getEnumConstants()) { if (enumVal.name().equals(unknownEnumName)) { return enumVal; } } ...
[ "public", "static", "Enum", "<", "?", ">", "findMatchingEnumVal", "(", "Field", "field", ",", "String", "unknownEnumName", ")", "{", "if", "(", "unknownEnumName", "==", "null", "||", "unknownEnumName", ".", "length", "(", ")", "==", "0", ")", "{", "return"...
Internal method that finds the matching enum for a configured field that has the name argument. @return The matching enum value or null if blank enum name. @throws IllegalArgumentException If the enum name is not known.
[ "Internal", "method", "that", "finds", "the", "matching", "enum", "for", "a", "configured", "field", "that", "has", "the", "name", "argument", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java#L658-L668
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedRefresh.java
MappedRefresh.executeRefresh
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { @SuppressWarnings("unchecked") ID id = (ID) idField.extractJavaFieldValue(data); // we don't care about the cache here T result = super.execute(databaseConnection, id, null); if (result =...
java
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { @SuppressWarnings("unchecked") ID id = (ID) idField.extractJavaFieldValue(data); // we don't care about the cache here T result = super.execute(databaseConnection, id, null); if (result =...
[ "public", "int", "executeRefresh", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "ID", "id", "=", "(", "ID", ")", "idF...
Execute our refresh query statement and then update all of the fields in data with the fields from the result. @return 1 if we found the object in the table by id or 0 if not.
[ "Execute", "our", "refresh", "query", "statement", "and", "then", "update", "all", "of", "the", "fields", "in", "data", "with", "the", "fields", "from", "the", "result", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedRefresh.java#L29-L46
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.selectColumns
public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; }
java
public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; }
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "selectColumns", "(", "String", "...", "columns", ")", "{", "for", "(", "String", "column", ":", "columns", ")", "{", "addSelectColumnToList", "(", "column", ")", ";", "}", "return", "this", ";", "}" ]
Add columns to be returned by the SELECT query. If no columns are selected then all columns are returned by default. For classes with id columns, the id column is added to the select list automagically. This can be called multiple times to add more columns to select. <p> <b>WARNING:</b> If you specify any columns to r...
[ "Add", "columns", "to", "be", "returned", "by", "the", "SELECT", "query", ".", "If", "no", "columns", "are", "selected", "then", "all", "columns", "are", "returned", "by", "default", ".", "For", "classes", "with", "id", "columns", "the", "id", "column", ...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L115-L120
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.groupBy
public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign collection field: " + columnName); } addGroupBy(ColumnNameOrRawSql.withColumnName(columnName)); return...
java
public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign collection field: " + columnName); } addGroupBy(ColumnNameOrRawSql.withColumnName(columnName)); return...
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "groupBy", "(", "String", "columnName", ")", "{", "FieldType", "fieldType", "=", "verifyColumnName", "(", "columnName", ")", ";", "if", "(", "fieldType", ".", "isForeignCollection", "(", ")", ")", "{", "t...
Add "GROUP BY" clause to the SQL query statement. This can be called multiple times to add additional "GROUP BY" clauses. <p> NOTE: Use of this means that the resulting objects may not have a valid ID column value so cannot be deleted or updated. </p>
[ "Add", "GROUP", "BY", "clause", "to", "the", "SQL", "query", "statement", ".", "This", "can", "be", "called", "multiple", "times", "to", "add", "additional", "GROUP", "BY", "clauses", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L154-L161
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.groupByRaw
public QueryBuilder<T, ID> groupByRaw(String rawSql) { addGroupBy(ColumnNameOrRawSql.withRawSql(rawSql)); return this; }
java
public QueryBuilder<T, ID> groupByRaw(String rawSql) { addGroupBy(ColumnNameOrRawSql.withRawSql(rawSql)); return this; }
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "groupByRaw", "(", "String", "rawSql", ")", "{", "addGroupBy", "(", "ColumnNameOrRawSql", ".", "withRawSql", "(", "rawSql", ")", ")", ";", "return", "this", ";", "}" ]
Add a raw SQL "GROUP BY" clause to the SQL query statement. This should not include the "GROUP BY".
[ "Add", "a", "raw", "SQL", "GROUP", "BY", "clause", "to", "the", "SQL", "query", "statement", ".", "This", "should", "not", "include", "the", "GROUP", "BY", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L166-L169
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.orderBy
public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName); } addOrderBy(new OrderBy(columnName, ascending)); ...
java
public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName); } addOrderBy(new OrderBy(columnName, ascending)); ...
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "orderBy", "(", "String", "columnName", ",", "boolean", "ascending", ")", "{", "FieldType", "fieldType", "=", "verifyColumnName", "(", "columnName", ")", ";", "if", "(", "fieldType", ".", "isForeignCollection...
Add "ORDER BY" clause to the SQL query statement. This can be called multiple times to add additional "ORDER BY" clauses. Ones earlier are applied first.
[ "Add", "ORDER", "BY", "clause", "to", "the", "SQL", "query", "statement", ".", "This", "can", "be", "called", "multiple", "times", "to", "add", "additional", "ORDER", "BY", "clauses", ".", "Ones", "earlier", "are", "applied", "first", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L175-L182
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.orderByRaw
public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; }
java
public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; }
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "orderByRaw", "(", "String", "rawSql", ")", "{", "addOrderBy", "(", "new", "OrderBy", "(", "rawSql", ",", "(", "ArgumentHolder", "[", "]", ")", "null", ")", ")", ";", "return", "this", ";", "}" ]
Add raw SQL "ORDER BY" clause to the SQL query statement. @param rawSql The raw SQL order by clause. This should not include the "ORDER BY".
[ "Add", "raw", "SQL", "ORDER", "BY", "clause", "to", "the", "SQL", "query", "statement", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L190-L193
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.join
public QueryBuilder<T, ID> join(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.INNER, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; }
java
public QueryBuilder<T, ID> join(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.INNER, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; }
[ "public", "QueryBuilder", "<", "T", ",", "ID", ">", "join", "(", "QueryBuilder", "<", "?", ",", "?", ">", "joinedQueryBuilder", ")", "throws", "SQLException", "{", "addJoinInfo", "(", "JoinType", ".", "INNER", ",", "null", ",", "null", ",", "joinedQueryBui...
Join with another query builder. This will add into the SQL something close to " INNER JOIN other-table ...". Either the object associated with the current QueryBuilder or the argument QueryBuilder must have a foreign field of the other one. An exception will be thrown otherwise. <p> <b>NOTE:</b> This will do combine ...
[ "Join", "with", "another", "query", "builder", ".", "This", "will", "add", "into", "the", "SQL", "something", "close", "to", "INNER", "JOIN", "other", "-", "table", "...", ".", "Either", "the", "object", "associated", "with", "the", "current", "QueryBuilder"...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L289-L292
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/QueryBuilder.java
QueryBuilder.addJoinInfo
private void addJoinInfo(JoinType type, String localColumnName, String joinedColumnName, QueryBuilder<?, ?> joinedQueryBuilder, JoinWhereOperation operation) throws SQLException { JoinInfo joinInfo = new JoinInfo(type, joinedQueryBuilder, operation); if (localColumnName == null) { matchJoinedFields(joinInfo, ...
java
private void addJoinInfo(JoinType type, String localColumnName, String joinedColumnName, QueryBuilder<?, ?> joinedQueryBuilder, JoinWhereOperation operation) throws SQLException { JoinInfo joinInfo = new JoinInfo(type, joinedQueryBuilder, operation); if (localColumnName == null) { matchJoinedFields(joinInfo, ...
[ "private", "void", "addJoinInfo", "(", "JoinType", "type", ",", "String", "localColumnName", ",", "String", "joinedColumnName", ",", "QueryBuilder", "<", "?", ",", "?", ">", "joinedQueryBuilder", ",", "JoinWhereOperation", "operation", ")", "throws", "SQLException",...
Add join info to the query. This can be called multiple times to join with more than one table.
[ "Add", "join", "info", "to", "the", "query", ".", "This", "can", "be", "called", "multiple", "times", "to", "join", "with", "more", "than", "one", "table", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L578-L590
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableInfo.java
TableInfo.objectToString
public String objectToString(T object) { StringBuilder sb = new StringBuilder(64); sb.append(object.getClass().getSimpleName()); for (FieldType fieldType : fieldTypes) { sb.append(' ').append(fieldType.getColumnName()).append('='); try { sb.append(fieldType.extractJavaFieldValue(object)); } catch (Ex...
java
public String objectToString(T object) { StringBuilder sb = new StringBuilder(64); sb.append(object.getClass().getSimpleName()); for (FieldType fieldType : fieldTypes) { sb.append(' ').append(fieldType.getColumnName()).append('='); try { sb.append(fieldType.extractJavaFieldValue(object)); } catch (Ex...
[ "public", "String", "objectToString", "(", "T", "object", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "64", ")", ";", "sb", ".", "append", "(", "object", ".", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", "for",...
Return a string representation of the object.
[ "Return", "a", "string", "representation", "of", "the", "object", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableInfo.java#L175-L187
train
j256/ormlite-core
src/main/java/com/j256/ormlite/misc/VersionUtils.java
VersionUtils.logVersionWarnings
private static void logVersionWarnings(String label1, String version1, String label2, String version2) { if (version1 == null) { if (version2 != null) { warning(null, "Unknown version", " for {}, version for {} is '{}'", new Object[] { label1, label2, version2 }); } } else { if (version2 == null)...
java
private static void logVersionWarnings(String label1, String version1, String label2, String version2) { if (version1 == null) { if (version2 != null) { warning(null, "Unknown version", " for {}, version for {} is '{}'", new Object[] { label1, label2, version2 }); } } else { if (version2 == null)...
[ "private", "static", "void", "logVersionWarnings", "(", "String", "label1", ",", "String", "version1", ",", "String", "label2", ",", "String", "version2", ")", "{", "if", "(", "version1", "==", "null", ")", "{", "if", "(", "version2", "!=", "null", ")", ...
Log error information
[ "Log", "error", "information" ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/VersionUtils.java#L51-L66
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementBuilder.java
StatementBuilder.prepareStatement
protected MappedPreparedStmt<T, ID> prepareStatement(Long limit, boolean cacheStore) throws SQLException { List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>(); String statement = buildStatementString(argList); ArgumentHolder[] selectArgs = argList.toArray(new ArgumentHolder[argList.size()]); FieldTyp...
java
protected MappedPreparedStmt<T, ID> prepareStatement(Long limit, boolean cacheStore) throws SQLException { List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>(); String statement = buildStatementString(argList); ArgumentHolder[] selectArgs = argList.toArray(new ArgumentHolder[argList.size()]); FieldTyp...
[ "protected", "MappedPreparedStmt", "<", "T", ",", "ID", ">", "prepareStatement", "(", "Long", "limit", ",", "boolean", "cacheStore", ")", "throws", "SQLException", "{", "List", "<", "ArgumentHolder", ">", "argList", "=", "new", "ArrayList", "<", "ArgumentHolder"...
Prepare our statement for the subclasses. @param limit Limit for queries. Can be null if none.
[ "Prepare", "our", "statement", "for", "the", "subclasses", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementBuilder.java#L73-L87
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementBuilder.java
StatementBuilder.prepareStatementString
public String prepareStatementString() throws SQLException { List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>(); return buildStatementString(argList); }
java
public String prepareStatementString() throws SQLException { List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>(); return buildStatementString(argList); }
[ "public", "String", "prepareStatementString", "(", ")", "throws", "SQLException", "{", "List", "<", "ArgumentHolder", ">", "argList", "=", "new", "ArrayList", "<", "ArgumentHolder", ">", "(", ")", ";", "return", "buildStatementString", "(", "argList", ")", ";", ...
Build and return a string version of the query. If you change the where or make other calls you will need to re-call this method to re-prepare the query for execution.
[ "Build", "and", "return", "a", "string", "version", "of", "the", "query", ".", "If", "you", "change", "the", "where", "or", "make", "other", "calls", "you", "will", "need", "to", "re", "-", "call", "this", "method", "to", "re", "-", "prepare", "the", ...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementBuilder.java#L93-L96
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementBuilder.java
StatementBuilder.appendWhereStatement
protected boolean appendWhereStatement(StringBuilder sb, List<ArgumentHolder> argList, WhereOperation operation) throws SQLException { if (where == null) { return operation == WhereOperation.FIRST; } operation.appendBefore(sb); where.appendSql((addTableName ? getTableName() : null), sb, argList); operat...
java
protected boolean appendWhereStatement(StringBuilder sb, List<ArgumentHolder> argList, WhereOperation operation) throws SQLException { if (where == null) { return operation == WhereOperation.FIRST; } operation.appendBefore(sb); where.appendSql((addTableName ? getTableName() : null), sb, argList); operat...
[ "protected", "boolean", "appendWhereStatement", "(", "StringBuilder", "sb", ",", "List", "<", "ArgumentHolder", ">", "argList", ",", "WhereOperation", "operation", ")", "throws", "SQLException", "{", "if", "(", "where", "==", "null", ")", "{", "return", "operati...
Append the WHERE part of the statement to the StringBuilder.
[ "Append", "the", "WHERE", "part", "of", "the", "statement", "to", "the", "StringBuilder", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementBuilder.java#L145-L154
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedDeleteCollection.java
MappedDeleteCollection.build
private static <T, ID> MappedDeleteCollection<T, ID> build(Dao<T, ID> dao, TableInfo<T, ID> tableInfo, int dataSize) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException( "Cannot delete " + tableInfo.getDataClass() + " because it doesn't have an ...
java
private static <T, ID> MappedDeleteCollection<T, ID> build(Dao<T, ID> dao, TableInfo<T, ID> tableInfo, int dataSize) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException( "Cannot delete " + tableInfo.getDataClass() + " because it doesn't have an ...
[ "private", "static", "<", "T", ",", "ID", ">", "MappedDeleteCollection", "<", "T", ",", "ID", ">", "build", "(", "Dao", "<", "T", ",", "ID", ">", "dao", ",", "TableInfo", "<", "T", ",", "ID", ">", "tableInfo", ",", "int", "dataSize", ")", "throws",...
This is private because the execute is the only method that should be called here.
[ "This", "is", "private", "because", "the", "execute", "is", "the", "only", "method", "that", "should", "be", "called", "here", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedDeleteCollection.java#L63-L76
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/SelectIterator.java
SelectIterator.next
@Override public T next() { SQLException sqlException = null; try { T result = nextThrow(); if (result != null) { return result; } } catch (SQLException e) { sqlException = e; } // we have to throw if there is no next or on a SQLException last = null; closeQuietly(); throw new IllegalSt...
java
@Override public T next() { SQLException sqlException = null; try { T result = nextThrow(); if (result != null) { return result; } } catch (SQLException e) { sqlException = e; } // we have to throw if there is no next or on a SQLException last = null; closeQuietly(); throw new IllegalSt...
[ "@", "Override", "public", "T", "next", "(", ")", "{", "SQLException", "sqlException", "=", "null", ";", "try", "{", "T", "result", "=", "nextThrow", "(", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "}", "ca...
Returns the next object in the table. @throws IllegalStateException If there was a problem extracting the object from SQL.
[ "Returns", "the", "next", "object", "in", "the", "table", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/SelectIterator.java#L177-L192
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.createTable
public static <T> int createTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException { Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass); return doCreateTable(dao, false); }
java
public static <T> int createTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException { Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass); return doCreateTable(dao, false); }
[ "public", "static", "<", "T", ">", "int", "createTable", "(", "ConnectionSource", "connectionSource", ",", "Class", "<", "T", ">", "dataClass", ")", "throws", "SQLException", "{", "Dao", "<", "T", ",", "?", ">", "dao", "=", "DaoManager", ".", "createDao", ...
Issue the database statements to create the table associated with a class. @param connectionSource Associated connection source. @param dataClass The class for which a table will be created. @return The number of statements executed to do so.
[ "Issue", "the", "database", "statements", "to", "create", "the", "table", "associated", "with", "a", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L53-L56
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.createTable
public static <T> int createTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig) throws SQLException { Dao<T, ?> dao = DaoManager.createDao(connectionSource, tableConfig); return doCreateTable(dao, false); }
java
public static <T> int createTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig) throws SQLException { Dao<T, ?> dao = DaoManager.createDao(connectionSource, tableConfig); return doCreateTable(dao, false); }
[ "public", "static", "<", "T", ">", "int", "createTable", "(", "ConnectionSource", "connectionSource", ",", "DatabaseTableConfig", "<", "T", ">", "tableConfig", ")", "throws", "SQLException", "{", "Dao", "<", "T", ",", "?", ">", "dao", "=", "DaoManager", ".",...
Issue the database statements to create the table associated with a table configuration. @param connectionSource connectionSource Associated connection source. @param tableConfig Hand or spring wired table configuration. If null then the class must have {@link DatabaseField} annotations. @return The number of statemen...
[ "Issue", "the", "database", "statements", "to", "create", "the", "table", "associated", "with", "a", "table", "configuration", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L88-L92
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.dropTable
public static <T, ID> int dropTable(ConnectionSource connectionSource, Class<T> dataClass, boolean ignoreErrors) throws SQLException { Dao<T, ID> dao = DaoManager.createDao(connectionSource, dataClass); return dropTable(dao, ignoreErrors); }
java
public static <T, ID> int dropTable(ConnectionSource connectionSource, Class<T> dataClass, boolean ignoreErrors) throws SQLException { Dao<T, ID> dao = DaoManager.createDao(connectionSource, dataClass); return dropTable(dao, ignoreErrors); }
[ "public", "static", "<", "T", ",", "ID", ">", "int", "dropTable", "(", "ConnectionSource", "connectionSource", ",", "Class", "<", "T", ">", "dataClass", ",", "boolean", "ignoreErrors", ")", "throws", "SQLException", "{", "Dao", "<", "T", ",", "ID", ">", ...
Issue the database statements to drop the table associated with a class. <p> <b>WARNING:</b> This is [obviously] very destructive and is unrecoverable. </p> @param connectionSource Associated connection source. @param dataClass The class for which a table will be dropped. @param ignoreErrors If set to true then try e...
[ "Issue", "the", "database", "statements", "to", "drop", "the", "table", "associated", "with", "a", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L170-L174
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.dropTable
public static <T, ID> int dropTable(Dao<T, ID> dao, boolean ignoreErrors) throws SQLException { ConnectionSource connectionSource = dao.getConnectionSource(); Class<T> dataClass = dao.getDataClass(); DatabaseType databaseType = connectionSource.getDatabaseType(); if (dao instanceof BaseDaoImpl<?, ?>) { retur...
java
public static <T, ID> int dropTable(Dao<T, ID> dao, boolean ignoreErrors) throws SQLException { ConnectionSource connectionSource = dao.getConnectionSource(); Class<T> dataClass = dao.getDataClass(); DatabaseType databaseType = connectionSource.getDatabaseType(); if (dao instanceof BaseDaoImpl<?, ?>) { retur...
[ "public", "static", "<", "T", ",", "ID", ">", "int", "dropTable", "(", "Dao", "<", "T", ",", "ID", ">", "dao", ",", "boolean", "ignoreErrors", ")", "throws", "SQLException", "{", "ConnectionSource", "connectionSource", "=", "dao", ".", "getConnectionSource",...
Issue the database statements to drop the table associated with a dao. @param dao Associated dao. @return The number of statements executed to do so.
[ "Issue", "the", "database", "statements", "to", "drop", "the", "table", "associated", "with", "a", "dao", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L183-L193
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.dropTable
public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig, boolean ignoreErrors) throws SQLException { DatabaseType databaseType = connectionSource.getDatabaseType(); Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig); if (dao instanceof BaseDao...
java
public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig, boolean ignoreErrors) throws SQLException { DatabaseType databaseType = connectionSource.getDatabaseType(); Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig); if (dao instanceof BaseDao...
[ "public", "static", "<", "T", ",", "ID", ">", "int", "dropTable", "(", "ConnectionSource", "connectionSource", ",", "DatabaseTableConfig", "<", "T", ">", "tableConfig", ",", "boolean", "ignoreErrors", ")", "throws", "SQLException", "{", "DatabaseType", "databaseTy...
Issue the database statements to drop the table associated with a table configuration. <p> <b>WARNING:</b> This is [obviously] very destructive and is unrecoverable. </p> @param connectionSource Associated connection source. @param tableConfig Hand or spring wired table configuration. If null then the class must have...
[ "Issue", "the", "database", "statements", "to", "drop", "the", "table", "associated", "with", "a", "table", "configuration", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L211-L222
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.addDropTableStatements
private static <T, ID> void addDropTableStatements(DatabaseType databaseType, TableInfo<T, ID> tableInfo, List<String> statements, boolean logDetails) { List<String> statementsBefore = new ArrayList<String>(); List<String> statementsAfter = new ArrayList<String>(); for (FieldType fieldType : tableInfo.getField...
java
private static <T, ID> void addDropTableStatements(DatabaseType databaseType, TableInfo<T, ID> tableInfo, List<String> statements, boolean logDetails) { List<String> statementsBefore = new ArrayList<String>(); List<String> statementsAfter = new ArrayList<String>(); for (FieldType fieldType : tableInfo.getField...
[ "private", "static", "<", "T", ",", "ID", ">", "void", "addDropTableStatements", "(", "DatabaseType", "databaseType", ",", "TableInfo", "<", "T", ",", "ID", ">", "tableInfo", ",", "List", "<", "String", ">", "statements", ",", "boolean", "logDetails", ")", ...
Generate and return the list of statements to drop a database table.
[ "Generate", "and", "return", "the", "list", "of", "statements", "to", "drop", "a", "database", "table", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L319-L336
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/TableUtils.java
TableUtils.addCreateTableStatements
private static <T, ID> void addCreateTableStatements(DatabaseType databaseType, TableInfo<T, ID> tableInfo, List<String> statements, List<String> queriesAfter, boolean ifNotExists, boolean logDetails) throws SQLException { StringBuilder sb = new StringBuilder(256); if (logDetails) { logger.info("creating t...
java
private static <T, ID> void addCreateTableStatements(DatabaseType databaseType, TableInfo<T, ID> tableInfo, List<String> statements, List<String> queriesAfter, boolean ifNotExists, boolean logDetails) throws SQLException { StringBuilder sb = new StringBuilder(256); if (logDetails) { logger.info("creating t...
[ "private", "static", "<", "T", ",", "ID", ">", "void", "addCreateTableStatements", "(", "DatabaseType", "databaseType", ",", "TableInfo", "<", "T", ",", "ID", ">", "tableInfo", ",", "List", "<", "String", ">", "statements", ",", "List", "<", "String", ">",...
Generate and return the list of statements to create a database table and any associated features.
[ "Generate", "and", "return", "the", "list", "of", "statements", "to", "create", "a", "database", "table", "and", "any", "associated", "features", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L440-L495
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.assignField
public void assignField(ConnectionSource connectionSource, Object data, Object val, boolean parentObject, ObjectCache objectCache) throws SQLException { if (logger.isLevelEnabled(Level.TRACE)) { logger.trace("assiging from data {}, val {}: {}", (data == null ? "null" : data.getClass()), (val == null ? "nu...
java
public void assignField(ConnectionSource connectionSource, Object data, Object val, boolean parentObject, ObjectCache objectCache) throws SQLException { if (logger.isLevelEnabled(Level.TRACE)) { logger.trace("assiging from data {}, val {}: {}", (data == null ? "null" : data.getClass()), (val == null ? "nu...
[ "public", "void", "assignField", "(", "ConnectionSource", "connectionSource", ",", "Object", "data", ",", "Object", "val", ",", "boolean", "parentObject", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "logger", ".", "isLevelEnab...
Assign to the data object the val corresponding to the fieldType.
[ "Assign", "to", "the", "data", "object", "the", "val", "corresponding", "to", "the", "fieldType", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L525-L582
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.assignIdValue
public Object assignIdValue(ConnectionSource connectionSource, Object data, Number val, ObjectCache objectCache) throws SQLException { Object idVal = dataPersister.convertIdNumber(val); if (idVal == null) { throw new SQLException("Invalid class " + dataPersister + " for sequence-id " + this); } else { as...
java
public Object assignIdValue(ConnectionSource connectionSource, Object data, Number val, ObjectCache objectCache) throws SQLException { Object idVal = dataPersister.convertIdNumber(val); if (idVal == null) { throw new SQLException("Invalid class " + dataPersister + " for sequence-id " + this); } else { as...
[ "public", "Object", "assignIdValue", "(", "ConnectionSource", "connectionSource", ",", "Object", "data", ",", "Number", "val", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "Object", "idVal", "=", "dataPersister", ".", "convertIdNumber", "("...
Assign an ID value to this field.
[ "Assign", "an", "ID", "value", "to", "this", "field", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L587-L596
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.extractRawJavaFieldValue
public <FV> FV extractRawJavaFieldValue(Object object) throws SQLException { Object val; if (fieldGetMethod == null) { try { // field object may not be a T yet val = field.get(object); } catch (Exception e) { throw SqlExceptionUtil.create("Could not get field value for " + this, e); } } else ...
java
public <FV> FV extractRawJavaFieldValue(Object object) throws SQLException { Object val; if (fieldGetMethod == null) { try { // field object may not be a T yet val = field.get(object); } catch (Exception e) { throw SqlExceptionUtil.create("Could not get field value for " + this, e); } } else ...
[ "public", "<", "FV", ">", "FV", "extractRawJavaFieldValue", "(", "Object", "object", ")", "throws", "SQLException", "{", "Object", "val", ";", "if", "(", "fieldGetMethod", "==", "null", ")", "{", "try", "{", "// field object may not be a T yet", "val", "=", "f...
Return the value from the field in the object that is defined by this FieldType.
[ "Return", "the", "value", "from", "the", "field", "in", "the", "object", "that", "is", "defined", "by", "this", "FieldType", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L601-L621
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.extractJavaFieldValue
public Object extractJavaFieldValue(Object object) throws SQLException { Object val = extractRawJavaFieldValue(object); // if this is a foreign object then we want its reference field if (foreignRefField != null && val != null) { val = foreignRefField.extractRawJavaFieldValue(val); } return val; }
java
public Object extractJavaFieldValue(Object object) throws SQLException { Object val = extractRawJavaFieldValue(object); // if this is a foreign object then we want its reference field if (foreignRefField != null && val != null) { val = foreignRefField.extractRawJavaFieldValue(val); } return val; }
[ "public", "Object", "extractJavaFieldValue", "(", "Object", "object", ")", "throws", "SQLException", "{", "Object", "val", "=", "extractRawJavaFieldValue", "(", "object", ")", ";", "// if this is a foreign object then we want its reference field", "if", "(", "foreignRefFiel...
Return the value from the field in the object that is defined by this FieldType. If the field is a foreign object then the ID of the field is returned instead.
[ "Return", "the", "value", "from", "the", "field", "in", "the", "object", "that", "is", "defined", "by", "this", "FieldType", ".", "If", "the", "field", "is", "a", "foreign", "object", "then", "the", "ID", "of", "the", "field", "is", "returned", "instead"...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L627-L637
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.convertJavaFieldToSqlArgValue
public Object convertJavaFieldToSqlArgValue(Object fieldVal) throws SQLException { /* * Limitation here. Some people may want to override the null with their own value in the converter but we * currently don't allow that. Specifying a default value I guess is a better mechanism. */ if (fieldVal == null) { ...
java
public Object convertJavaFieldToSqlArgValue(Object fieldVal) throws SQLException { /* * Limitation here. Some people may want to override the null with their own value in the converter but we * currently don't allow that. Specifying a default value I guess is a better mechanism. */ if (fieldVal == null) { ...
[ "public", "Object", "convertJavaFieldToSqlArgValue", "(", "Object", "fieldVal", ")", "throws", "SQLException", "{", "/*\n\t\t * Limitation here. Some people may want to override the null with their own value in the converter but we\n\t\t * currently don't allow that. Specifying a default value I...
Convert a field value to something suitable to be stored in the database.
[ "Convert", "a", "field", "value", "to", "something", "suitable", "to", "be", "stored", "in", "the", "database", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L649-L659
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.convertStringToJavaField
public Object convertStringToJavaField(String value, int columnPos) throws SQLException { if (value == null) { return null; } else { return fieldConverter.resultStringToJava(this, value, columnPos); } }
java
public Object convertStringToJavaField(String value, int columnPos) throws SQLException { if (value == null) { return null; } else { return fieldConverter.resultStringToJava(this, value, columnPos); } }
[ "public", "Object", "convertStringToJavaField", "(", "String", "value", ",", "int", "columnPos", ")", "throws", "SQLException", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "fieldConverter", ".", "result...
Convert a string value into the appropriate Java field value.
[ "Convert", "a", "string", "value", "into", "the", "appropriate", "Java", "field", "value", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L664-L670
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.moveToNextValue
public Object moveToNextValue(Object val) throws SQLException { if (dataPersister == null) { return null; } else { return dataPersister.moveToNextValue(val); } }
java
public Object moveToNextValue(Object val) throws SQLException { if (dataPersister == null) { return null; } else { return dataPersister.moveToNextValue(val); } }
[ "public", "Object", "moveToNextValue", "(", "Object", "val", ")", "throws", "SQLException", "{", "if", "(", "dataPersister", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "dataPersister", ".", "moveToNextValue", "(", "val", ")", ...
Move the SQL value to the next one for version processing.
[ "Move", "the", "SQL", "value", "to", "the", "next", "one", "for", "version", "processing", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L675-L681
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.buildForeignCollection
public <FT, FID> BaseForeignCollection<FT, FID> buildForeignCollection(Object parent, FID id) throws SQLException { // this can happen if we have a foreign-auto-refresh scenario if (foreignFieldType == null) { return null; } @SuppressWarnings("unchecked") Dao<FT, FID> castDao = (Dao<FT, FID>) foreignDao; ...
java
public <FT, FID> BaseForeignCollection<FT, FID> buildForeignCollection(Object parent, FID id) throws SQLException { // this can happen if we have a foreign-auto-refresh scenario if (foreignFieldType == null) { return null; } @SuppressWarnings("unchecked") Dao<FT, FID> castDao = (Dao<FT, FID>) foreignDao; ...
[ "public", "<", "FT", ",", "FID", ">", "BaseForeignCollection", "<", "FT", ",", "FID", ">", "buildForeignCollection", "(", "Object", "parent", ",", "FID", "id", ")", "throws", "SQLException", "{", "// this can happen if we have a foreign-auto-refresh scenario", "if", ...
Build and return a foreign collection based on the field settings that matches the id argument. This can return null in certain circumstances. @param parent The parent object that we will set on each item in the collection. @param id The id of the foreign object we will look for. This can be null if we are creating an...
[ "Build", "and", "return", "a", "foreign", "collection", "based", "on", "the", "field", "settings", "that", "matches", "the", "id", "argument", ".", "This", "can", "return", "null", "in", "certain", "circumstances", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L781-L823
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.getFieldValueIfNotDefault
public <FV> FV getFieldValueIfNotDefault(Object object) throws SQLException { @SuppressWarnings("unchecked") FV fieldValue = (FV) extractJavaFieldValue(object); if (isFieldValueDefault(fieldValue)) { return null; } else { return fieldValue; } }
java
public <FV> FV getFieldValueIfNotDefault(Object object) throws SQLException { @SuppressWarnings("unchecked") FV fieldValue = (FV) extractJavaFieldValue(object); if (isFieldValueDefault(fieldValue)) { return null; } else { return fieldValue; } }
[ "public", "<", "FV", ">", "FV", "getFieldValueIfNotDefault", "(", "Object", "object", ")", "throws", "SQLException", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "FV", "fieldValue", "=", "(", "FV", ")", "extractJavaFieldValue", "(", "object", ")", ...
Return the value of field in the data argument if it is not the default value for the class. If it is the default then null is returned.
[ "Return", "the", "value", "of", "field", "in", "the", "data", "argument", "if", "it", "is", "not", "the", "default", "value", "for", "the", "class", ".", "If", "it", "is", "the", "default", "then", "null", "is", "returned", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L927-L935
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.isObjectsFieldValueDefault
public boolean isObjectsFieldValueDefault(Object object) throws SQLException { Object fieldValue = extractJavaFieldValue(object); return isFieldValueDefault(fieldValue); }
java
public boolean isObjectsFieldValueDefault(Object object) throws SQLException { Object fieldValue = extractJavaFieldValue(object); return isFieldValueDefault(fieldValue); }
[ "public", "boolean", "isObjectsFieldValueDefault", "(", "Object", "object", ")", "throws", "SQLException", "{", "Object", "fieldValue", "=", "extractJavaFieldValue", "(", "object", ")", ";", "return", "isFieldValueDefault", "(", "fieldValue", ")", ";", "}" ]
Return whether or not the data object has a default value passed for this field of this type.
[ "Return", "whether", "or", "not", "the", "data", "object", "has", "a", "default", "value", "passed", "for", "this", "field", "of", "this", "type", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L940-L943
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.getJavaDefaultValueDefault
public Object getJavaDefaultValueDefault() { if (field.getType() == boolean.class) { return DEFAULT_VALUE_BOOLEAN; } else if (field.getType() == byte.class || field.getType() == Byte.class) { return DEFAULT_VALUE_BYTE; } else if (field.getType() == char.class || field.getType() == Character.class) { retu...
java
public Object getJavaDefaultValueDefault() { if (field.getType() == boolean.class) { return DEFAULT_VALUE_BOOLEAN; } else if (field.getType() == byte.class || field.getType() == Byte.class) { return DEFAULT_VALUE_BYTE; } else if (field.getType() == char.class || field.getType() == Character.class) { retu...
[ "public", "Object", "getJavaDefaultValueDefault", "(", ")", "{", "if", "(", "field", ".", "getType", "(", ")", "==", "boolean", ".", "class", ")", "{", "return", "DEFAULT_VALUE_BOOLEAN", ";", "}", "else", "if", "(", "field", ".", "getType", "(", ")", "==...
Return whether or not the field value passed in is the default value for the type of the field. Null will return true.
[ "Return", "whether", "or", "not", "the", "field", "value", "passed", "in", "is", "the", "default", "value", "for", "the", "type", "of", "the", "field", ".", "Null", "will", "return", "true", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L949-L969
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.createForeignShell
private <FT, FID> FT createForeignShell(ConnectionSource connectionSource, Object val, ObjectCache objectCache) throws SQLException { @SuppressWarnings("unchecked") Dao<FT, FID> castDao = (Dao<FT, FID>) foreignDao; FT foreignObject = castDao.createObjectInstance(); foreignIdField.assignField(connectionSource...
java
private <FT, FID> FT createForeignShell(ConnectionSource connectionSource, Object val, ObjectCache objectCache) throws SQLException { @SuppressWarnings("unchecked") Dao<FT, FID> castDao = (Dao<FT, FID>) foreignDao; FT foreignObject = castDao.createObjectInstance(); foreignIdField.assignField(connectionSource...
[ "private", "<", "FT", ",", "FID", ">", "FT", "createForeignShell", "(", "ConnectionSource", "connectionSource", ",", "Object", "val", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Dao", ...
Create a shell object and assign its id field.
[ "Create", "a", "shell", "object", "and", "assign", "its", "id", "field", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L1084-L1091
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/FieldType.java
FieldType.findForeignFieldType
private FieldType findForeignFieldType(Class<?> clazz, Class<?> foreignClass, Dao<?, ?> foreignDao) throws SQLException { String foreignColumnName = fieldConfig.getForeignCollectionForeignFieldName(); for (FieldType fieldType : foreignDao.getTableInfo().getFieldTypes()) { if (fieldType.getType() == foreignCla...
java
private FieldType findForeignFieldType(Class<?> clazz, Class<?> foreignClass, Dao<?, ?> foreignDao) throws SQLException { String foreignColumnName = fieldConfig.getForeignCollectionForeignFieldName(); for (FieldType fieldType : foreignDao.getTableInfo().getFieldTypes()) { if (fieldType.getType() == foreignCla...
[ "private", "FieldType", "findForeignFieldType", "(", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", ">", "foreignClass", ",", "Dao", "<", "?", ",", "?", ">", "foreignDao", ")", "throws", "SQLException", "{", "String", "foreignColumnName", "=", "f...
If we have a class Foo with a collection of Bar's then we go through Bar's DAO looking for a Foo field. We need this field to build the query that is able to find all Bar's that have foo_id that matches our id.
[ "If", "we", "have", "a", "class", "Foo", "with", "a", "collection", "of", "Bar", "s", "then", "we", "go", "through", "Bar", "s", "DAO", "looking", "for", "a", "Foo", "field", ".", "We", "need", "this", "field", "to", "build", "the", "query", "that", ...
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L1109-L1132
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedQueryForFieldEq.java
MappedQueryForFieldEq.execute
public T execute(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException { if (objectCache != null) { T result = objectCache.get(clazz, id); if (result != null) { return result; } } Object[] args = new Object[] { convertIdToFieldObject(id) }; // @SuppressWarnings(...
java
public T execute(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException { if (objectCache != null) { T result = objectCache.get(clazz, id); if (result != null) { return result; } } Object[] args = new Object[] { convertIdToFieldObject(id) }; // @SuppressWarnings(...
[ "public", "T", "execute", "(", "DatabaseConnection", "databaseConnection", ",", "ID", "id", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "objectCache", "!=", "null", ")", "{", "T", "result", "=", "objectCache", ".", "get", ...
Query for an object in the database which matches the id argument.
[ "Query", "for", "an", "object", "in", "the", "database", "which", "matches", "the", "id", "argument", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedQueryForFieldEq.java#L30-L53
train
j256/ormlite-core
src/main/java/com/j256/ormlite/db/BaseDatabaseType.java
BaseDatabaseType.appendStringType
protected void appendStringType(StringBuilder sb, FieldType fieldType, int fieldWidth) { if (isVarcharFieldWidthSupported()) { sb.append("VARCHAR(").append(fieldWidth).append(')'); } else { sb.append("VARCHAR"); } }
java
protected void appendStringType(StringBuilder sb, FieldType fieldType, int fieldWidth) { if (isVarcharFieldWidthSupported()) { sb.append("VARCHAR(").append(fieldWidth).append(')'); } else { sb.append("VARCHAR"); } }
[ "protected", "void", "appendStringType", "(", "StringBuilder", "sb", ",", "FieldType", "fieldType", ",", "int", "fieldWidth", ")", "{", "if", "(", "isVarcharFieldWidthSupported", "(", ")", ")", "{", "sb", ".", "append", "(", "\"VARCHAR(\"", ")", ".", "append",...
Output the SQL type for a Java String.
[ "Output", "the", "SQL", "type", "for", "a", "Java", "String", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/db/BaseDatabaseType.java#L205-L211
train
j256/ormlite-core
src/main/java/com/j256/ormlite/db/BaseDatabaseType.java
BaseDatabaseType.appendDefaultValue
private void appendDefaultValue(StringBuilder sb, FieldType fieldType, Object defaultValue) { if (fieldType.isEscapedDefaultValue()) { appendEscapedWord(sb, defaultValue.toString()); } else { sb.append(defaultValue); } }
java
private void appendDefaultValue(StringBuilder sb, FieldType fieldType, Object defaultValue) { if (fieldType.isEscapedDefaultValue()) { appendEscapedWord(sb, defaultValue.toString()); } else { sb.append(defaultValue); } }
[ "private", "void", "appendDefaultValue", "(", "StringBuilder", "sb", ",", "FieldType", "fieldType", ",", "Object", "defaultValue", ")", "{", "if", "(", "fieldType", ".", "isEscapedDefaultValue", "(", ")", ")", "{", "appendEscapedWord", "(", "sb", ",", "defaultVa...
Output the SQL type for the default value for the type.
[ "Output", "the", "SQL", "type", "for", "the", "default", "value", "for", "the", "type", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/db/BaseDatabaseType.java#L315-L321
train
j256/ormlite-core
src/main/java/com/j256/ormlite/db/BaseDatabaseType.java
BaseDatabaseType.addSingleUnique
private void addSingleUnique(StringBuilder sb, FieldType fieldType, List<String> additionalArgs, List<String> statementsAfter) { StringBuilder alterSb = new StringBuilder(); alterSb.append(" UNIQUE ("); appendEscapedEntityName(alterSb, fieldType.getColumnName()); alterSb.append(')'); additionalArgs.add(alt...
java
private void addSingleUnique(StringBuilder sb, FieldType fieldType, List<String> additionalArgs, List<String> statementsAfter) { StringBuilder alterSb = new StringBuilder(); alterSb.append(" UNIQUE ("); appendEscapedEntityName(alterSb, fieldType.getColumnName()); alterSb.append(')'); additionalArgs.add(alt...
[ "private", "void", "addSingleUnique", "(", "StringBuilder", "sb", ",", "FieldType", "fieldType", ",", "List", "<", "String", ">", "additionalArgs", ",", "List", "<", "String", ">", "statementsAfter", ")", "{", "StringBuilder", "alterSb", "=", "new", "StringBuild...
Add SQL to handle a unique=true field. THis is not for uniqueCombo=true.
[ "Add", "SQL", "to", "handle", "a", "unique", "=", "true", "field", ".", "THis", "is", "not", "for", "uniqueCombo", "=", "true", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/db/BaseDatabaseType.java#L631-L638
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DataPersisterManager.java
DataPersisterManager.registerDataPersisters
public static void registerDataPersisters(DataPersister... dataPersisters) { // we build the map and replace it to lower the chance of concurrency issues List<DataPersister> newList = new ArrayList<DataPersister>(); if (registeredPersisters != null) { newList.addAll(registeredPersisters); } for (DataPersis...
java
public static void registerDataPersisters(DataPersister... dataPersisters) { // we build the map and replace it to lower the chance of concurrency issues List<DataPersister> newList = new ArrayList<DataPersister>(); if (registeredPersisters != null) { newList.addAll(registeredPersisters); } for (DataPersis...
[ "public", "static", "void", "registerDataPersisters", "(", "DataPersister", "...", "dataPersisters", ")", "{", "// we build the map and replace it to lower the chance of concurrency issues", "List", "<", "DataPersister", ">", "newList", "=", "new", "ArrayList", "<", "DataPers...
Register a data type with the manager.
[ "Register", "a", "data", "type", "with", "the", "manager", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DataPersisterManager.java#L51-L61
train
j256/ormlite-core
src/main/java/com/j256/ormlite/field/DataPersisterManager.java
DataPersisterManager.lookupForField
public static DataPersister lookupForField(Field field) { // see if the any of the registered persisters are valid first if (registeredPersisters != null) { for (DataPersister persister : registeredPersisters) { if (persister.isValidForField(field)) { return persister; } // check the classes in...
java
public static DataPersister lookupForField(Field field) { // see if the any of the registered persisters are valid first if (registeredPersisters != null) { for (DataPersister persister : registeredPersisters) { if (persister.isValidForField(field)) { return persister; } // check the classes in...
[ "public", "static", "DataPersister", "lookupForField", "(", "Field", "field", ")", "{", "// see if the any of the registered persisters are valid first", "if", "(", "registeredPersisters", "!=", "null", ")", "{", "for", "(", "DataPersister", "persister", ":", "registeredP...
Lookup the data-type associated with the class. @return The associated data-type interface or null if none found.
[ "Lookup", "the", "data", "-", "type", "associated", "with", "the", "class", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DataPersisterManager.java#L75-L111
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedUpdate.java
MappedUpdate.update
public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { // there is always and id field as an argument so just return 0 lines updated if (argFieldTypes.length <= 1) { return 0; } Object[] args = getFieldObjects(data); Object newVersion =...
java
public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { // there is always and id field as an argument so just return 0 lines updated if (argFieldTypes.length <= 1) { return 0; } Object[] args = getFieldObjects(data); Object newVersion =...
[ "public", "int", "update", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "try", "{", "// there is always and id field as an argument so just return 0 lines updated", "if", "(", "argF...
Update the object in the database.
[ "Update", "the", "object", "in", "the", "database", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedUpdate.java#L91-L134
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedStatement.java
BaseMappedStatement.getFieldObjects
protected Object[] getFieldObjects(Object data) throws SQLException { Object[] objects = new Object[argFieldTypes.length]; for (int i = 0; i < argFieldTypes.length; i++) { FieldType fieldType = argFieldTypes[i]; if (fieldType.isAllowGeneratedIdInsert()) { objects[i] = fieldType.getFieldValueIfNotDefault(d...
java
protected Object[] getFieldObjects(Object data) throws SQLException { Object[] objects = new Object[argFieldTypes.length]; for (int i = 0; i < argFieldTypes.length; i++) { FieldType fieldType = argFieldTypes[i]; if (fieldType.isAllowGeneratedIdInsert()) { objects[i] = fieldType.getFieldValueIfNotDefault(d...
[ "protected", "Object", "[", "]", "getFieldObjects", "(", "Object", "data", ")", "throws", "SQLException", "{", "Object", "[", "]", "objects", "=", "new", "Object", "[", "argFieldTypes", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i...
Return the array of field objects pulled from the data object.
[ "Return", "the", "array", "of", "field", "objects", "pulled", "from", "the", "data", "object", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedStatement.java#L45-L60
train
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedPreparedStmt.java
MappedPreparedStmt.assignStatementArguments
private CompiledStatement assignStatementArguments(CompiledStatement stmt) throws SQLException { boolean ok = false; try { if (limit != null) { // we use this if SQL statement LIMITs are not supported by this database type stmt.setMaxRows(limit.intValue()); } // set any arguments if we are logging ...
java
private CompiledStatement assignStatementArguments(CompiledStatement stmt) throws SQLException { boolean ok = false; try { if (limit != null) { // we use this if SQL statement LIMITs are not supported by this database type stmt.setMaxRows(limit.intValue()); } // set any arguments if we are logging ...
[ "private", "CompiledStatement", "assignStatementArguments", "(", "CompiledStatement", "stmt", ")", "throws", "SQLException", "{", "boolean", "ok", "=", "false", ";", "try", "{", "if", "(", "limit", "!=", "null", ")", "{", "// we use this if SQL statement LIMITs are no...
Assign arguments to the statement. @return The statement passed in or null if it had to be closed on error.
[ "Assign", "arguments", "to", "the", "statement", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedPreparedStmt.java#L89-L127
train
j256/ormlite-core
src/main/java/com/j256/ormlite/support/BaseConnectionSource.java
BaseConnectionSource.getSavedConnection
protected DatabaseConnection getSavedConnection() { NestedConnection nested = specialConnection.get(); if (nested == null) { return null; } else { return nested.connection; } }
java
protected DatabaseConnection getSavedConnection() { NestedConnection nested = specialConnection.get(); if (nested == null) { return null; } else { return nested.connection; } }
[ "protected", "DatabaseConnection", "getSavedConnection", "(", ")", "{", "NestedConnection", "nested", "=", "specialConnection", ".", "get", "(", ")", ";", "if", "(", "nested", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "nested...
Returns the connection that has been saved or null if none.
[ "Returns", "the", "connection", "that", "has", "been", "saved", "or", "null", "if", "none", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L29-L36
train
j256/ormlite-core
src/main/java/com/j256/ormlite/support/BaseConnectionSource.java
BaseConnectionSource.isSavedConnection
protected boolean isSavedConnection(DatabaseConnection connection) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return false; } else if (currentSaved.connection == connection) { // ignore the release when we have a saved connection return true; } else { retu...
java
protected boolean isSavedConnection(DatabaseConnection connection) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return false; } else if (currentSaved.connection == connection) { // ignore the release when we have a saved connection return true; } else { retu...
[ "protected", "boolean", "isSavedConnection", "(", "DatabaseConnection", "connection", ")", "{", "NestedConnection", "currentSaved", "=", "specialConnection", ".", "get", "(", ")", ";", "if", "(", "currentSaved", "==", "null", ")", "{", "return", "false", ";", "}...
Return true if the connection being released is the one that has been saved.
[ "Return", "true", "if", "the", "connection", "being", "released", "is", "the", "one", "that", "has", "been", "saved", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L41-L51
train
j256/ormlite-core
src/main/java/com/j256/ormlite/support/BaseConnectionSource.java
BaseConnectionSource.clearSpecial
protected boolean clearSpecial(DatabaseConnection connection, Logger logger) { NestedConnection currentSaved = specialConnection.get(); boolean cleared = false; if (connection == null) { // ignored } else if (currentSaved == null) { logger.error("no connection has been saved when clear() called"); } els...
java
protected boolean clearSpecial(DatabaseConnection connection, Logger logger) { NestedConnection currentSaved = specialConnection.get(); boolean cleared = false; if (connection == null) { // ignored } else if (currentSaved == null) { logger.error("no connection has been saved when clear() called"); } els...
[ "protected", "boolean", "clearSpecial", "(", "DatabaseConnection", "connection", ",", "Logger", "logger", ")", "{", "NestedConnection", "currentSaved", "=", "specialConnection", ".", "get", "(", ")", ";", "boolean", "cleared", "=", "false", ";", "if", "(", "conn...
Clear the connection that was previously saved. @return True if the connection argument had been saved.
[ "Clear", "the", "connection", "that", "was", "previously", "saved", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L80-L98
train
j256/ormlite-core
src/main/java/com/j256/ormlite/support/BaseConnectionSource.java
BaseConnectionSource.isSingleConnection
protected boolean isSingleConnection(DatabaseConnection conn1, DatabaseConnection conn2) throws SQLException { // initialize the connections auto-commit flags conn1.setAutoCommit(true); conn2.setAutoCommit(true); try { // change conn1's auto-commit to be false conn1.setAutoCommit(false); if (conn2.isAu...
java
protected boolean isSingleConnection(DatabaseConnection conn1, DatabaseConnection conn2) throws SQLException { // initialize the connections auto-commit flags conn1.setAutoCommit(true); conn2.setAutoCommit(true); try { // change conn1's auto-commit to be false conn1.setAutoCommit(false); if (conn2.isAu...
[ "protected", "boolean", "isSingleConnection", "(", "DatabaseConnection", "conn1", ",", "DatabaseConnection", "conn2", ")", "throws", "SQLException", "{", "// initialize the connections auto-commit flags", "conn1", ".", "setAutoCommit", "(", "true", ")", ";", "conn2", ".",...
Return true if the two connections seem to one one connection under the covers.
[ "Return", "true", "if", "the", "two", "connections", "seem", "to", "one", "one", "connection", "under", "the", "covers", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/support/BaseConnectionSource.java#L103-L121
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.loadDatabaseConfigFromReader
public static List<DatabaseTableConfig<?>> loadDatabaseConfigFromReader(BufferedReader reader) throws SQLException { List<DatabaseTableConfig<?>> list = new ArrayList<DatabaseTableConfig<?>>(); while (true) { DatabaseTableConfig<?> config = DatabaseTableConfigLoader.fromReader(reader); if (config == null) { ...
java
public static List<DatabaseTableConfig<?>> loadDatabaseConfigFromReader(BufferedReader reader) throws SQLException { List<DatabaseTableConfig<?>> list = new ArrayList<DatabaseTableConfig<?>>(); while (true) { DatabaseTableConfig<?> config = DatabaseTableConfigLoader.fromReader(reader); if (config == null) { ...
[ "public", "static", "List", "<", "DatabaseTableConfig", "<", "?", ">", ">", "loadDatabaseConfigFromReader", "(", "BufferedReader", "reader", ")", "throws", "SQLException", "{", "List", "<", "DatabaseTableConfig", "<", "?", ">", ">", "list", "=", "new", "ArrayLis...
Load in a number of database configuration entries from a buffered reader.
[ "Load", "in", "a", "number", "of", "database", "configuration", "entries", "from", "a", "buffered", "reader", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L29-L39
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.fromReader
public static <T> DatabaseTableConfig<T> fromReader(BufferedReader reader) throws SQLException { DatabaseTableConfig<T> config = new DatabaseTableConfig<T>(); boolean anything = false; while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.cre...
java
public static <T> DatabaseTableConfig<T> fromReader(BufferedReader reader) throws SQLException { DatabaseTableConfig<T> config = new DatabaseTableConfig<T>(); boolean anything = false; while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.cre...
[ "public", "static", "<", "T", ">", "DatabaseTableConfig", "<", "T", ">", "fromReader", "(", "BufferedReader", "reader", ")", "throws", "SQLException", "{", "DatabaseTableConfig", "<", "T", ">", "config", "=", "new", "DatabaseTableConfig", "<", "T", ">", "(", ...
Load a table configuration in from a text-file reader. @return A config if any of the fields were set otherwise null if we reach EOF.
[ "Load", "a", "table", "configuration", "in", "from", "a", "text", "-", "file", "reader", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L46-L86
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.write
public static <T> void write(BufferedWriter writer, DatabaseTableConfig<T> config) throws SQLException { try { writeConfig(writer, config); } catch (IOException e) { throw SqlExceptionUtil.create("Could not write config to writer", e); } }
java
public static <T> void write(BufferedWriter writer, DatabaseTableConfig<T> config) throws SQLException { try { writeConfig(writer, config); } catch (IOException e) { throw SqlExceptionUtil.create("Could not write config to writer", e); } }
[ "public", "static", "<", "T", ">", "void", "write", "(", "BufferedWriter", "writer", ",", "DatabaseTableConfig", "<", "T", ">", "config", ")", "throws", "SQLException", "{", "try", "{", "writeConfig", "(", "writer", ",", "config", ")", ";", "}", "catch", ...
Write the table configuration to a buffered writer.
[ "Write", "the", "table", "configuration", "to", "a", "buffered", "writer", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L91-L97
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.writeConfig
private static <T> void writeConfig(BufferedWriter writer, DatabaseTableConfig<T> config) throws IOException, SQLException { writer.append(CONFIG_FILE_START_MARKER); writer.newLine(); if (config.getDataClass() != null) { writer.append(FIELD_NAME_DATA_CLASS).append('=').append(config.getDataClass().getName()...
java
private static <T> void writeConfig(BufferedWriter writer, DatabaseTableConfig<T> config) throws IOException, SQLException { writer.append(CONFIG_FILE_START_MARKER); writer.newLine(); if (config.getDataClass() != null) { writer.append(FIELD_NAME_DATA_CLASS).append('=').append(config.getDataClass().getName()...
[ "private", "static", "<", "T", ">", "void", "writeConfig", "(", "BufferedWriter", "writer", ",", "DatabaseTableConfig", "<", "T", ">", "config", ")", "throws", "IOException", ",", "SQLException", "{", "writer", ".", "append", "(", "CONFIG_FILE_START_MARKER", ")"...
Write the config to the writer.
[ "Write", "the", "config", "to", "the", "writer", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L106-L129
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.readTableField
private static <T> void readTableField(DatabaseTableConfig<T> config, String field, String value) { if (field.equals(FIELD_NAME_DATA_CLASS)) { try { @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) Class.forName(value); config.setDataClass(clazz); } catch (ClassNotFoundException e) { t...
java
private static <T> void readTableField(DatabaseTableConfig<T> config, String field, String value) { if (field.equals(FIELD_NAME_DATA_CLASS)) { try { @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) Class.forName(value); config.setDataClass(clazz); } catch (ClassNotFoundException e) { t...
[ "private", "static", "<", "T", ">", "void", "readTableField", "(", "DatabaseTableConfig", "<", "T", ">", "config", ",", "String", "field", ",", "String", "value", ")", "{", "if", "(", "field", ".", "equals", "(", "FIELD_NAME_DATA_CLASS", ")", ")", "{", "...
Read a field into our table configuration for field=value line.
[ "Read", "a", "field", "into", "our", "table", "configuration", "for", "field", "=", "value", "line", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L134-L146
train
j256/ormlite-core
src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java
DatabaseTableConfigLoader.readFields
private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException { List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>(); while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.create...
java
private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException { List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>(); while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.create...
[ "private", "static", "<", "T", ">", "void", "readFields", "(", "BufferedReader", "reader", ",", "DatabaseTableConfig", "<", "T", ">", "config", ")", "throws", "SQLException", "{", "List", "<", "DatabaseFieldConfig", ">", "fields", "=", "new", "ArrayList", "<",...
Read all of the fields information from the configuration file.
[ "Read", "all", "of", "the", "fields", "information", "from", "the", "configuration", "file", "." ]
154d85bbb9614a0ea65a012251257831fb4fba21
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L151-L170
train
HubSpot/jackson-datatype-protobuf
src/main/java/com/hubspot/jackson/datatype/protobuf/ProtobufDeserializer.java
ProtobufDeserializer.readKey
private Object readKey( FieldDescriptor field, JsonParser parser, DeserializationContext context ) throws IOException { if (parser.getCurrentToken() != JsonToken.FIELD_NAME) { throw reportWrongToken(JsonToken.FIELD_NAME, context, "Expected FIELD_NAME token"); } String ...
java
private Object readKey( FieldDescriptor field, JsonParser parser, DeserializationContext context ) throws IOException { if (parser.getCurrentToken() != JsonToken.FIELD_NAME) { throw reportWrongToken(JsonToken.FIELD_NAME, context, "Expected FIELD_NAME token"); } String ...
[ "private", "Object", "readKey", "(", "FieldDescriptor", "field", ",", "JsonParser", "parser", ",", "DeserializationContext", "context", ")", "throws", "IOException", "{", "if", "(", "parser", ".", "getCurrentToken", "(", ")", "!=", "JsonToken", ".", "FIELD_NAME", ...
Specialized version of readValue just for reading map keys, because the StdDeserializer methods like _parseIntPrimitive blow up when the current JsonToken is FIELD_NAME
[ "Specialized", "version", "of", "readValue", "just", "for", "reading", "map", "keys", "because", "the", "StdDeserializer", "methods", "like", "_parseIntPrimitive", "blow", "up", "when", "the", "current", "JsonToken", "is", "FIELD_NAME" ]
33c6c8085421387d43770c6599fe1b9cb27ad10e
https://github.com/HubSpot/jackson-datatype-protobuf/blob/33c6c8085421387d43770c6599fe1b9cb27ad10e/src/main/java/com/hubspot/jackson/datatype/protobuf/ProtobufDeserializer.java#L132-L196
train
bujiio/buji-pac4j
src/main/java/io/buji/pac4j/util/ShiroHelper.java
ShiroHelper.populateSubject
public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) { if (profiles != null && profiles.size() > 0) { final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles); try { if (IS_FULLY_AUTHENTICATED_AUTHORIZER.isAu...
java
public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) { if (profiles != null && profiles.size() > 0) { final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles); try { if (IS_FULLY_AUTHENTICATED_AUTHORIZER.isAu...
[ "public", "static", "void", "populateSubject", "(", "final", "LinkedHashMap", "<", "String", ",", "CommonProfile", ">", "profiles", ")", "{", "if", "(", "profiles", "!=", "null", "&&", "profiles", ".", "size", "(", ")", ">", "0", ")", "{", "final", "List...
Populate the authenticated user profiles in the Shiro subject. @param profiles the linked hashmap of profiles
[ "Populate", "the", "authenticated", "user", "profiles", "in", "the", "Shiro", "subject", "." ]
5ce149161f359074df09bc47b9f2aed8e17141a2
https://github.com/bujiio/buji-pac4j/blob/5ce149161f359074df09bc47b9f2aed8e17141a2/src/main/java/io/buji/pac4j/util/ShiroHelper.java#L51-L64
train
bujiio/buji-pac4j
src/main/java/io/buji/pac4j/subject/Pac4jPrincipal.java
Pac4jPrincipal.getName
@Override public String getName() { CommonProfile profile = this.getProfile(); if(null == principalNameAttribute) { return profile.getId(); } Object attrValue = profile.getAttribute(principalNameAttribute); return (null == attrValue) ? null : String.valueOf(attrVa...
java
@Override public String getName() { CommonProfile profile = this.getProfile(); if(null == principalNameAttribute) { return profile.getId(); } Object attrValue = profile.getAttribute(principalNameAttribute); return (null == attrValue) ? null : String.valueOf(attrVa...
[ "@", "Override", "public", "String", "getName", "(", ")", "{", "CommonProfile", "profile", "=", "this", ".", "getProfile", "(", ")", ";", "if", "(", "null", "==", "principalNameAttribute", ")", "{", "return", "profile", ".", "getId", "(", ")", ";", "}", ...
Returns a name for the principal based upon one of the attributes of the main CommonProfile. The attribute name used to query the CommonProfile is specified in the constructor. @return a name for the Principal or null if the attribute is not populated.
[ "Returns", "a", "name", "for", "the", "principal", "based", "upon", "one", "of", "the", "attributes", "of", "the", "main", "CommonProfile", ".", "The", "attribute", "name", "used", "to", "query", "the", "CommonProfile", "is", "specified", "in", "the", "const...
5ce149161f359074df09bc47b9f2aed8e17141a2
https://github.com/bujiio/buji-pac4j/blob/5ce149161f359074df09bc47b9f2aed8e17141a2/src/main/java/io/buji/pac4j/subject/Pac4jPrincipal.java#L107-L115
train
Talend/tesb-rt-se
examples/tesb/library-service/common/src/main/java/org/talend/services/demos/common/Utils.java
Utils.showBooks
public static void showBooks(final ListOfBooks booksList){ if(booksList != null && booksList.getBook() != null && !booksList.getBook().isEmpty()){ List<BookType> books = booksList.getBook(); System.out.println("\nNumber of books: " + books.size()); int cnt = 0; for (BookType book : boo...
java
public static void showBooks(final ListOfBooks booksList){ if(booksList != null && booksList.getBook() != null && !booksList.getBook().isEmpty()){ List<BookType> books = booksList.getBook(); System.out.println("\nNumber of books: " + books.size()); int cnt = 0; for (BookType book : boo...
[ "public", "static", "void", "showBooks", "(", "final", "ListOfBooks", "booksList", ")", "{", "if", "(", "booksList", "!=", "null", "&&", "booksList", ".", "getBook", "(", ")", "!=", "null", "&&", "!", "booksList", ".", "getBook", "(", ")", ".", "isEmpty"...
Show books. @param booksList the books list
[ "Show", "books", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/examples/tesb/library-service/common/src/main/java/org/talend/services/demos/common/Utils.java#L19-L45
train
Talend/tesb-rt-se
examples/tesb/locator-service/soap-service/war/src/main/java/demo/service/ContextListener.java
ContextListener.contextInitialized
public void contextInitialized(ServletContextEvent event) { this.context = event.getServletContext(); // Output a simple message to the server's console System.out.println("The Simple Web App. Is Ready"); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( ...
java
public void contextInitialized(ServletContextEvent event) { this.context = event.getServletContext(); // Output a simple message to the server's console System.out.println("The Simple Web App. Is Ready"); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( ...
[ "public", "void", "contextInitialized", "(", "ServletContextEvent", "event", ")", "{", "this", ".", "context", "=", "event", ".", "getServletContext", "(", ")", ";", "// Output a simple message to the server's console", "System", ".", "out", ".", "println", "(", "\"...
is ready to service requests
[ "is", "ready", "to", "service", "requests" ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/examples/tesb/locator-service/soap-service/war/src/main/java/demo/service/ContextListener.java#L63-L85
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.serializeEPR
private void serializeEPR(EndpointReferenceType wsAddr, Node parent) throws ServiceLocatorException { try { JAXBElement<EndpointReferenceType> ep = WSA_OBJECT_FACTORY.createEndpointReference(wsAddr); createMarshaller().marshal(ep, parent); } catch (JAXBException e...
java
private void serializeEPR(EndpointReferenceType wsAddr, Node parent) throws ServiceLocatorException { try { JAXBElement<EndpointReferenceType> ep = WSA_OBJECT_FACTORY.createEndpointReference(wsAddr); createMarshaller().marshal(ep, parent); } catch (JAXBException e...
[ "private", "void", "serializeEPR", "(", "EndpointReferenceType", "wsAddr", ",", "Node", "parent", ")", "throws", "ServiceLocatorException", "{", "try", "{", "JAXBElement", "<", "EndpointReferenceType", ">", "ep", "=", "WSA_OBJECT_FACTORY", ".", "createEndpointReference"...
Inserts a marshalled endpoint reference to a given DOM tree rooted by parent. @param wsAddr @param parent @throws ServiceLocatorException
[ "Inserts", "a", "marshalled", "endpoint", "reference", "to", "a", "given", "DOM", "tree", "rooted", "by", "parent", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L205-L217
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.createEPR
private static EndpointReferenceType createEPR(String address, SLProperties props) { EndpointReferenceType epr = WSAEndpointReferenceUtils.getEndpointReference(address); if (props != null) { addProperties(epr, props); } return epr; }
java
private static EndpointReferenceType createEPR(String address, SLProperties props) { EndpointReferenceType epr = WSAEndpointReferenceUtils.getEndpointReference(address); if (props != null) { addProperties(epr, props); } return epr; }
[ "private", "static", "EndpointReferenceType", "createEPR", "(", "String", "address", ",", "SLProperties", "props", ")", "{", "EndpointReferenceType", "epr", "=", "WSAEndpointReferenceUtils", ".", "getEndpointReference", "(", "address", ")", ";", "if", "(", "props", ...
Creates an endpoint reference from a given adress. @param address @param props @return
[ "Creates", "an", "endpoint", "reference", "from", "a", "given", "adress", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L279-L285
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.createEPR
private static EndpointReferenceType createEPR(Server server, String address, SLProperties props) { EndpointReferenceType sourceEPR = server.getEndpoint().getEndpointInfo().getTarget(); EndpointReferenceType targetEPR = WSAEndpointReferenceUtils.duplicate(sourceEPR); WSAEndpointReferenceUtils.se...
java
private static EndpointReferenceType createEPR(Server server, String address, SLProperties props) { EndpointReferenceType sourceEPR = server.getEndpoint().getEndpointInfo().getTarget(); EndpointReferenceType targetEPR = WSAEndpointReferenceUtils.duplicate(sourceEPR); WSAEndpointReferenceUtils.se...
[ "private", "static", "EndpointReferenceType", "createEPR", "(", "Server", "server", ",", "String", "address", ",", "SLProperties", "props", ")", "{", "EndpointReferenceType", "sourceEPR", "=", "server", ".", "getEndpoint", "(", ")", ".", "getEndpointInfo", "(", ")...
Creates an endpoint reference by duplicating the endpoint reference of a given server. @param server @param address @param props @return
[ "Creates", "an", "endpoint", "reference", "by", "duplicating", "the", "endpoint", "reference", "of", "a", "given", "server", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L294-L303
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.addProperties
private static void addProperties(EndpointReferenceType epr, SLProperties props) { MetadataType metadata = WSAEndpointReferenceUtils.getSetMetadata(epr); ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); JAXBElement<ServiceLocatorPropertiesTyp...
java
private static void addProperties(EndpointReferenceType epr, SLProperties props) { MetadataType metadata = WSAEndpointReferenceUtils.getSetMetadata(epr); ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); JAXBElement<ServiceLocatorPropertiesTyp...
[ "private", "static", "void", "addProperties", "(", "EndpointReferenceType", "epr", ",", "SLProperties", "props", ")", "{", "MetadataType", "metadata", "=", "WSAEndpointReferenceUtils", ".", "getSetMetadata", "(", "epr", ")", ";", "ServiceLocatorPropertiesType", "jaxbPro...
Adds service locator properties to an endpoint reference. @param epr @param props
[ "Adds", "service", "locator", "properties", "to", "an", "endpoint", "reference", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L310-L317
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.getServiceName
private static QName getServiceName(Server server) { QName serviceName; String bindingId = getBindingId(server); EndpointInfo eInfo = server.getEndpoint().getEndpointInfo(); if (JAXRS_BINDING_ID.equals(bindingId)) { serviceName = eInfo.getName(); } else { ...
java
private static QName getServiceName(Server server) { QName serviceName; String bindingId = getBindingId(server); EndpointInfo eInfo = server.getEndpoint().getEndpointInfo(); if (JAXRS_BINDING_ID.equals(bindingId)) { serviceName = eInfo.getName(); } else { ...
[ "private", "static", "QName", "getServiceName", "(", "Server", "server", ")", "{", "QName", "serviceName", ";", "String", "bindingId", "=", "getBindingId", "(", "server", ")", ";", "EndpointInfo", "eInfo", "=", "server", ".", "getEndpoint", "(", ")", ".", "g...
Extracts the service name from a Server. @param server @return
[ "Extracts", "the", "service", "name", "from", "a", "Server", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L324-L336
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.getBindingId
private static String getBindingId(Server server) { Endpoint ep = server.getEndpoint(); BindingInfo bi = ep.getBinding().getBindingInfo(); return bi.getBindingId(); }
java
private static String getBindingId(Server server) { Endpoint ep = server.getEndpoint(); BindingInfo bi = ep.getBinding().getBindingInfo(); return bi.getBindingId(); }
[ "private", "static", "String", "getBindingId", "(", "Server", "server", ")", "{", "Endpoint", "ep", "=", "server", ".", "getEndpoint", "(", ")", ";", "BindingInfo", "bi", "=", "ep", ".", "getBinding", "(", ")", ".", "getBindingInfo", "(", ")", ";", "retu...
Extracts the bindingId from a Server. @param server @return
[ "Extracts", "the", "bindingId", "from", "a", "Server", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L343-L347
train
Talend/tesb-rt-se
locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java
CXFEndpointProvider.map2BindingType
private static BindingType map2BindingType(String bindingId) { BindingType type; if (SOAP11_BINDING_ID.equals(bindingId)) { type = BindingType.SOAP11; } else if (SOAP12_BINDING_ID.equals(bindingId)) { type = BindingType.SOAP12; } else if (JAXRS_BINDING_ID.equals(b...
java
private static BindingType map2BindingType(String bindingId) { BindingType type; if (SOAP11_BINDING_ID.equals(bindingId)) { type = BindingType.SOAP11; } else if (SOAP12_BINDING_ID.equals(bindingId)) { type = BindingType.SOAP12; } else if (JAXRS_BINDING_ID.equals(b...
[ "private", "static", "BindingType", "map2BindingType", "(", "String", "bindingId", ")", "{", "BindingType", "type", ";", "if", "(", "SOAP11_BINDING_ID", ".", "equals", "(", "bindingId", ")", ")", "{", "type", "=", "BindingType", ".", "SOAP11", ";", "}", "els...
Maps a bindingId to its corresponding BindingType. @param bindingId @return
[ "Maps", "a", "bindingId", "to", "its", "corresponding", "BindingType", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/cxf/internal/CXFEndpointProvider.java#L363-L375
train