id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
64185596_63 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java",
"identifier": "DalSingleTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateTask() {\n\t\tDalSingleTaskRequest<Integer> test = null;\n\t\ttest = new DalSingleTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new DalHints(), 1, new TestSingleTask());\n\t\ttry {\n\t\t\ttest.validateAndPrepare();\n\t\t\tCallable<int[]> task = test.createTask();\n\t\t\tassertNo... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n public TaskCallable<int[]> createTask() {\n return new SingleTaskCallable<>(hints, daoPojos, rawPojos, task, dalTaskContext, callback);\n }",
"class_method_signature": "DalSingleTaskRequest.createTask()",
"constructor": false,
"full_signature": "@Override public TaskCallable<... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_5 | {
"fields": [
{
"declarator": "databaseResource",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private DatabaseResource databaseResource;",
"type": "DatabaseResource",
"var_name": "databaseResource"
},
{
"declarator": "dalGroupDBDao",
... | {
"body": "@Test\n public void hasDalClusterTest() throws Exception {\n Status status1 = databaseResource.hasDalCluster(null);\n assertEquals(\"false\", status1.getInfo());\n\n DatabaseResource resource = Mockito.spy(DatabaseResource.class);\n Mockito.doReturn(false).when(resource).chec... | {
"fields": [
{
"declarator": "classLoader",
"modifier": "private static",
"original_string": "private static ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "mapper = new ObjectMapper()",
"modifier": "private static"... | {
"body": "@POST\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"hasDalCluster\")\n public Status hasDalCluster(@FormParam(\"namebase\") String nameBase) {\n try {\n Status status = Status.OK();\n if (StringUtils.isEmpty(nameBase)) {\n status.setInfo(\"false\");\... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_75 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSet() {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n StatementParameters p = new StatementParameters();\n test.with(p);\n test.select(template).from(template).where(equal(template)).set(temp... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder set(String name, Object value, int sqlType) {\n context.getParameters().set(nextIndex(), name, sqlType, value);\n return this;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.set(String name, Object value, int sqlType)",
"constructor": false,
"fu... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_22 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getTableShardShardIdWorkTest() {\n final TableShardContext context = new TableShardContext(\"whatever\");\n context.setShardId(\"100\");\n context.setShardValue(100);\n\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7); // ... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)",
"constructor": false,
"full_s... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_29 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void testGetTableShardForNullTable() {\n final TableShardContext assignationShardIdContext = new TableShardContext(\"whatever\").setShardId(\"100\");\n try {\n cluster.getTableShard(null, assignationShardIdContext);\n Assert.fail();\n } catch (Ex... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)",
"constructor": false,
"full_s... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_146 | {
"fields": [
{
"declarator": "noShardDb = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String noShardDb = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "noShardDb"
},
{
"declarator": "shardDb = \"dao_test_sql... | {
"body": "@Test\n\tpublic void testGetNewConnection() {\n\t\tboolean useMaster = true;\n\t\tDalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\tDalConnectionManager test = getDalConnectionManager(noShardDb);\n\t\t\tDalConnection conn = test.getNewConnection(hints, useMaster, DalEventEnum.BATCH_CALL);\n\t\t\tass... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private DalConfigure config;",
"type": "DalConfigure",
"var_name": "config"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDb... | {
"body": "public DalConnection getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation)\n\t\t\tthrows SQLException {\n\t\tDalConnection connHolder = null;\n\t\tString realDbName = logicDbName;\n\t\ttry\n\t\t{\n\t\t\tif(DalStatusManager.getDatabaseSetStatus(logicDbName).isMarkdown())\n\t\t\t\tthrow... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_91 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testHaving() {\n AbstractFreeSqlBuilder test = create();\n test.having(template);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"HAVING \" + template, test.build());\n }",
"class_method_signature": "Abstra... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder having(String condition) {\n return append(HAVING).append(condition);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.having(String condition)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder having(String condition)",
"identif... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_111 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testIsNull() {\n AbstractFreeSqlBuilder test = create();\n test.isNull(template);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(wrappedTemplate + \" IS NULL\", test.build());\n assertEquals(0, test.buildP... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder isNull(String name) {\n return append(Expressions.isNull(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.isNull(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder isNull(String name)",
"identifier": "isNull",... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_68 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testWith() {\n AbstractFreeSqlBuilder test = create();\n try {\n test.with(null);\n fail();\n } catch (Exception e) {\n }\n \n StatementParameters p = new StatementParameters();\n test.with(p);\n // Same is... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder with(StatementParameters parameters) {\n context.setParameters(parameters);\n return this;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.with(StatementParameters parameters)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuild... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_107 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testBetween() {\n String result = wrappedTemplate + \" BETWEEN ? AND ?\";\n testExpression(result, 2, new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().between(template);\n }\n publ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder between(String name) {\n return append(Expressions.between(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.between(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder between(String name)",
"identifier": "betw... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_87 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testIncludeAll() {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n test.select(template).from(template).where(AbstractFreeSqlBuilder.includeAll()).equal(template);\n assertEquals(\"SELECT [template] FROM ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static Clause includeAll() {\n return new ClauseList().add(Expressions.expression(\"1=1\"), Expressions.AND);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.includeAll()",
"constructor": false,
"full_signature": "public static Clause includeAll()",
"identifier": "includeAl... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_150 | {
"fields": [
{
"declarator": "logicDbName = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "logicDbName"
}
],
"file": "dal-client/src/test/java/com/c... | {
"body": "@Test\n\tpublic void testIsInTransaction() {\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tConnectionAction<?> action = new ConnectionAction<Object>() {\n\t\t\t\tpublic Object ex... | {
"fields": [
{
"declarator": "connManager",
"modifier": "private",
"original_string": "private DalConnectionManager connManager;",
"type": "DalConnectionManager",
"var_name": "connManager"
},
{
"declarator": "transactionHolder = new ThreadLocal<DalTransaction>()",
... | {
"body": "public static boolean isInTransaction() {\n return transactionHolder.get() != null;\n }",
"class_method_signature": "DalTransactionManager.isInTransaction()",
"constructor": false,
"full_signature": "public static boolean isInTransaction()",
"identifier": "isInTransaction",
"invocations... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_44 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDalBulkTaskRequest() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = new DalBulkTaskRequest<>(\"\", \"\", null, new ArrayList<TestPojo>(), new TestBulkTask());\n\t\tassertNotNull(test);\n\t}",
"class_method_signature": "DalBulkTaskRequestTest.testDalBulkTaskRequest()",
"con... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "public DalBulkTaskRequest(String logicDbName, String rawTableName, DalHints hints, List<T> rawPojos, BulkTask<K, T> task) {\n\t\tthis(logicDbName, rawTableName, hints, rawPojos, task, null);\n\t}",
"class_method_signature": "DalBulkTaskRequest.DalBulkTaskRequest(String logicDbName, String rawTableName, D... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_13 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getDbShardNullTest() {\n final Integer table1ShardIndex = cluster.getDbShard(\"table1\", new DbShardContext(\"whatever\"));\n Assert.assertNull(table1ShardIndex);\n }",
"class_method_signature": "DefaultClusterTest.getDbShardNullTest()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)",
"constructor": false,
"full_signature": "@O... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_185 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalBase64Test.java",
"identifier": "DalBase64Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void encodeBase64() throws Exception {\n String someSeeds = \"123456abcdef,.!@#$\";\n checkEncode(generateString(someSeeds, 5));\n checkEncode(generateString(someSeeds, 10));\n checkEncode(generateString(someSeeds, 50));\n checkEncode(generateString(some... | {
"fields": [
{
"declarator": "CHUNK_SEPARATOR = {'\\r', '\\n'}",
"modifier": "static final",
"original_string": "static final byte[] CHUNK_SEPARATOR = {'\\r', '\\n'};",
"type": "byte[]",
"var_name": "CHUNK_SEPARATOR"
}
],
"file": "dal-client/src/main/java/com/ctrip/platform/... | {
"body": "public static byte[] encodeBase64(final byte[] binaryData) {\n return encodeBase64(binaryData, false);\n }",
"class_method_signature": "DalBase64.encodeBase64(final byte[] binaryData)",
"constructor": false,
"full_signature": "public static byte[] encodeBase64(final byte[] binaryData)",
"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_52 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSqlTaskRequestTest.java",
"identifier": "DalSqlTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateTask() throws SQLException {\n\t\tDalSqlTaskRequest<Integer> test = null;\n\t\t\n\t\tDalHints hints = new DalHints();\n\t\ttest = new DalSqlTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new TestSqlBuilder(), hints, new TestSqlTask(1), new ResultMerger.IntSummary());\n\t\ttest.va... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private DalLogger logger;",
"type... | {
"body": "@Override\n public TaskCallable<T> createTask() throws SQLException {\n DalHints tmpHints = hints.clone();\n if (shards != null && shards.size() == 1) {\n tmpHints.inShard(shards.iterator().next());\n }\n\n return create(parameters, tmpHints, taskContext.fork(), tm... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_25 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getTableShardingEnabledTest() {\n final boolean table14Enabled = cluster.tableShardingEnabled(\"table14\");\n Assert.assertTrue(table14Enabled);\n\n final boolean table15Enabled = cluster.tableShardingEnabled(\"table15\");\n Assert.assertFalse(table15Enabl... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public boolean tableShardingEnabled(String tableName) {\n return shardStrategyProxy.tableShardingEnabled(tableName);\n }",
"class_method_signature": "DefaultCluster.tableShardingEnabled(String tableName)",
"constructor": false,
"full_signature": "@Override public boolean tabl... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_72 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testColumn() {\n AbstractFreeSqlBuilder test = create();\n test.append(column(template));\n assertEquals(wrappedTemplate, test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilderTest.testColumn()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static Column column(String name) {\n return new Column(name);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.column(String name)",
"constructor": false,
"full_signature": "public static Column column(String name)",
"identifier": "column",
"invocations": [],
"modifiers... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_64 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java",
"identifier": "DalSingleTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateTasks() {\n\t\tDalSingleTaskRequest<Integer> test = null;\n\t\tList<Integer> pojos = new ArrayList<>();\n\t\ttest = new DalSingleTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new DalHints(), pojos, new TestSingleTask());\n\t\ttry {\n\t\t\ttest.createTasks();\n\t\t\tfail();\n\t\t... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n public Map<String, TaskCallable<int[]>> createTasks() throws SQLException {\n throw new DalException(ErrorCode.NotSupported);\n }",
"class_method_signature": "DalSingleTaskRequest.createTasks()",
"constructor": false,
"full_signature": "@Override public Map<String, TaskCallab... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_2 | {
"fields": [
{
"declarator": "databaseResource",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private DatabaseResource databaseResource;",
"type": "DatabaseResource",
"var_name": "databaseResource"
},
{
"declarator": "dalGroupDBDao",
... | {
"body": "@Test\n public void getAllDB() {\n\n }",
"class_method_signature": "DatabaseResourceTest.getAllDB()",
"constructor": false,
"full_signature": "@Test public void getAllDB()",
"identifier": "getAllDB",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",... | {
"fields": [
{
"declarator": "classLoader",
"modifier": "private static",
"original_string": "private static ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "mapper = new ObjectMapper()",
"modifier": "private static"... | {
"body": "@POST\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllDB\")\n public Status getAllDB(@FormParam(\"dbType\") String dbType, @FormParam(\"dbModeType\") String dbModeType) {\n try {\n Status status = Status.OK();\n String className = CustomizedResource.getInstance... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_33 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java",
"identifier": "ConnectionStringParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseMySqlUrl2() {\n String ipUrl = \"jdbc:mysql://address=(type=master)(protocol=tcp)(host=10.1.1.1)(port=3308)/test?useUnicode=true&characterEncoding=UTF-8\";\n String domainUrl = \"jdbc:mysql://address=(type=master)(protocol=tcp)(host=test.db.com)(port=3308)/test... | {
"fields": [
{
"declarator": "parser = null",
"modifier": "private static",
"original_string": "private static ConnectionStringParser parser = null;",
"type": "ConnectionStringParser",
"var_name": "parser"
},
{
"declarator": "dburlPattern =\n Pattern.compile... | {
"body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_127 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testIn() throws SQLException {\n Clause test = in(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" IN ( ? )\", test.build());\n }",
"class_method_signature": "ExpressionsTest.testIn()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "NULL = new NullExpression()",
"modifier": "public static final",
"original_string": "public static final NullExpression NULL = new NullExpression();",
"type": "NullExpression",
"var_name": "NULL"
},
{
"declarator": "TRUE = new ImmutableExp... | {
"body": "public static ColumnExpression in(String name) {\n return new InExpression(name);\n }",
"class_method_signature": "Expressions.in(String name)",
"constructor": false,
"full_signature": "public static ColumnExpression in(String name)",
"identifier": "in",
"invocations": [],
"modifiers"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_48 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateTasks() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = null;\n\t\tList<TestPojo> pojos = null;\n\t\tMap<String, TaskCallable<Integer>> tasks = null;\n\t\ttry {\n\t\t\t// Shuffled in two shards\n\t\t\tpojos = new ArrayList<TestPojo>();\n\t\t\tpojos.add(new TestPojo(0));\n... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n\tpublic Map<String, TaskCallable<K>> createTasks() throws SQLException {\n\t\tMap<String, TaskCallable<K>> tasks = new HashMap<>();\n\t\t\n\t\t// I know this is not so elegant.\n\t\thandleKeyHolder(true);\n\t\t\n\t\tfor(String shard: shuffled.keySet()) {\n\t\t\tMap<Integer, Map<String, ?>> pojo... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_170 | {
"fields": [
{
"declarator": "properties = new Properties()",
"modifier": "private",
"original_string": "private Properties properties = new Properties();",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "dataSource = null",
"modifier": "privat... | {
"body": "@Test\n public void testConnectionType() throws SQLException {\n if (connection instanceof DalConnection) {\n //\n } else {\n Assert.fail();\n }\n connection.close();\n }",
"class_method_signature": "DalConnectionTest.testConnectionType()",
"const... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static",
"original_string": "private static ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declarator": "conne... | {
"body": "@Override\n public void close() throws SQLException {\n SQLException discardCause = discardCauseRef.get();\n if (discardCause != null) {\n try {\n markDiscard(discardCause);\n } catch (Throwable t) {\n LOGGER.warn(\"Mark connection discar... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_166 | {
"fields": [
{
"declarator": "IPHOST = \"10.32.20.128\"",
"modifier": "private final static",
"original_string": "private final static String IPHOST = \"10.32.20.128\";",
"type": "String",
"var_name": "IPHOST"
},
{
"declarator": "DOMAINHOST = \"dst56614\"",
"modi... | {
"body": "@Test\n public void testRestore() throws Exception {\n IDataSourceConfigureProvider provider = new MockDataSourceConfigureProvider();\n ForceSwitchableDataSource dataSource = new ForceSwitchableDataSource(provider);\n MockSwitchListener listener = new MockSwitchListener();\n ... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static",
"original_string": "private static ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declarator": "provi... | {
"body": "public SwitchableDataSourceStatus restore() {\n synchronized (lock) {\n final SwitchableDataSourceStatus oldStatus = getStatus();\n final String name = getSingleDataSource().getName();\n final String logName = String.format(RESTORE, name);\n\n try {\n ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_131 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testValues() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.values(noShardTableName);\n assertEquals(\"([noShard]) VALUES (?)\", test.build());\n \n test = createTest();\n test.values(noShardTableName, tableName);\... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder values(String...columnNames) {\n\t append(Expressions.leftBracket);\n StringBuilder valueFields = new StringBuilder();\n \n for (int i = 0; i < columnNames.length; i++) {\n appendColumn(columnNames[i]);\n valueFields.append(PLACE_HOL... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_130 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testInsertInto() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.insertInto(noShardTableName);\n assertEquals(\"INSERT INTO \" + wrappedNoShardTableName, test.build());\n \n test = createTest();\n\n test.insertInto(... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder insertInto(String tableName) {\n\t return insertInto(table(tableName));\n\t}",
"class_method_signature": "FreeUpdateSqlBuilder.insertInto(String tableName)",
"constructor": false,
"full_signature": "public FreeUpdateSqlBuilder insertInto(String tableName)",
"identifie... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_167 | {
"fields": [
{
"declarator": "IPHOST = \"10.32.20.128\"",
"modifier": "private final static",
"original_string": "private final static String IPHOST = \"10.32.20.128\";",
"type": "String",
"var_name": "IPHOST"
},
{
"declarator": "DOMAINHOST = \"dst56614\"",
"modi... | {
"body": "@Test\n public void testToString() throws Exception {\n IDataSourceConfigureProvider provider = new MockDataSourceConfigureProvider();\n ForceSwitchableDataSource dataSource = new ForceSwitchableDataSource(provider);\n SwitchableDataSourceStatus status = dataSource.getStatus();\n ... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static",
"original_string": "private static ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declarator": "provi... | {
"body": "public SwitchableDataSourceStatus getStatus() {\n synchronized (lock) {\n org.apache.tomcat.jdbc.pool.DataSource ds = (org.apache.tomcat.jdbc.pool.DataSource) getSingleDataSource().getDataSource();\n\n final String url = ds.getUrl();\n final String name = getSingleDa... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_188 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalSingleResultMergerTest.java",
"identifier": "DalSingleResultMergerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMerge() {\n\t\tDalSingleResultMerger<Object> test = new DalSingleResultMerger<>();\n\t\t\n\t\ttry {\n\t\t\ttest.addPartial(\"\", null);\n\t\t\ttest.addPartial(\"\", \"1\");\n\t\t} catch (SQLException e1) {\n\t\t\tAssert.fail();\n\t\t}\n\t\tAssert.assertEquals(\"1\", test.merge());\... | {
"fields": [
{
"declarator": "result",
"modifier": "private",
"original_string": "private T result;",
"type": "T",
"var_name": "result"
}
],
"file": "dal-client/src/main/java/com/ctrip/platform/dal/dao/helper/DalSingleResultMerger.java",
"identifier": "DalSingleResultMerge... | {
"body": "@Override\n\tpublic T merge() {\n\t\treturn result;\n\t}",
"class_method_signature": "DalSingleResultMerger.merge()",
"constructor": false,
"full_signature": "@Override public T merge()",
"identifier": "merge",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"return"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_171 | {
"fields": [
{
"declarator": "random = new Random()",
"modifier": "private",
"original_string": "private Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "dbName = \"dao_test\"",
"modifier": "private",
"original_stri... | {
"body": "@Test\n\tpublic void countBaseLineMatchTest() {\n\t\tTimeoutDetector detector = new TimeoutDetector();\n\t\tDalStatusManager.getMarkdownStatus().setEnableAutoMarkdown(true);\n\t\tDalStatusManager.getTimeoutMarkdown().setEnabled(true);\n\t\tDalStatusManager.getTimeoutMarkdown().setErrorCountThreshold(5);\n\... | {
"fields": [
{
"declarator": "data = new ConcurrentHashMap<String, DetectorCounter>()",
"modifier": "private",
"original_string": "private Map<String, DetectorCounter> data = new ConcurrentHashMap<String, DetectorCounter>();",
"type": "Map<String, DetectorCounter>",
"var_name": "dat... | {
"body": "@Override\n\tpublic void detect(ErrorContext ctx) {\t\n\t\tTimeoutMarkdown tmb = DalStatusManager.getTimeoutMarkdown();\n\n\t\tif(!tmb.isEnabled())\n\t\t\treturn;\n\n\t\tlong duration = tmb.getSamplingDuration() * 1000 + 10;\n\t\tif(!data.containsKey(ctx.getName()))\n\t\t\tdata.put(ctx.getName(), new Detec... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_126 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testNotlike() throws SQLException {\n Clause test = notLike(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" NOT LIKE ?\", test.build());\n }",
"class_method_signature": "ExpressionsTest.testNotlike()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "NULL = new NullExpression()",
"modifier": "public static final",
"original_string": "public static final NullExpression NULL = new NullExpression();",
"type": "NullExpression",
"var_name": "NULL"
},
{
"declarator": "TRUE = new ImmutableExp... | {
"body": "public static ColumnExpression notLike(String name) {\n return columnExpression(\"%s NOT LIKE ?\", name);\n }",
"class_method_signature": "Expressions.notLike(String name)",
"constructor": false,
"full_signature": "public static ColumnExpression notLike(String name)",
"identifier": "notLi... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_49 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetMerger() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = null;\n\t\tList<TestPojo> pojos = null;\n\t\tMap<String, Callable<Integer>> tasks = null;\n\t\ttry {\n\t\t\t// Shuffled in two shards\n\t\t\tpojos = new ArrayList<TestPojo>();\n\t\t\tpojos.add(new TestPojo(0));\n\t\t\t... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n\tpublic BulkTaskResultMerger<K> getMerger() {\n\t\treturn dbShardMerger;\n\t}",
"class_method_signature": "DalBulkTaskRequest.getMerger()",
"constructor": false,
"full_signature": "@Override public BulkTaskResultMerger<K> getMerger()",
"identifier": "getMerger",
"invocations": [],
"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_32 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java",
"identifier": "ConnectionStringParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseMySqlUrl1() {\n String ipUrl = \"jdbc:mysql://10.1.1.1:3308/test?useUnicode=true&characterEncoding=UTF-8\";\n String domainUrl = \"jdbc:mysql://test.db.com:3308/test?useUnicode=true&characterEncoding=UTF-8\";\n HostAndPort ipAndPort = ConnectionStringPar... | {
"fields": [
{
"declarator": "parser = null",
"modifier": "private static",
"original_string": "private static ConnectionStringParser parser = null;",
"type": "ConnectionStringParser",
"var_name": "parser"
},
{
"declarator": "dburlPattern =\n Pattern.compile... | {
"body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_65 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java",
"identifier": "DalSingleTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetMerger() {\n\t\tDalSingleTaskRequest<Integer> test = null;\n\t\tList<Integer> pojos = new ArrayList<>();\n\t\ttest = new DalSingleTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new DalHints(), pojos, new TestSingleTask());\n\t\tassertNull(test.getMerger());\n\t}",
"class_method_si... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n public ResultMerger<int[]> getMerger() {\n // Not support for now. Maybe support for new hints in the future\n return null;\n }",
"class_method_signature": "DalSingleTaskRequest.getMerger()",
"constructor": false,
"full_signature": "@Override public ResultMerger<int[]>... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_3 | {
"fields": [
{
"declarator": "databaseResource",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private DatabaseResource databaseResource;",
"type": "DatabaseResource",
"var_name": "databaseResource"
},
{
"declarator": "dalGroupDBDao",
... | {
"body": "@Test\n public void getBaseSetNameListTest() throws Exception {\n PowerMockito.mockStatic(BeanGetter.class);\n PowerMockito.when(BeanGetter.getDaoOfDalGroupDB()).thenReturn(dalGroupDBDao);\n Mockito.when(dalGroupDBDao.getDalClusterGroupDbsByGroupId(12, \"dalcluster\"))\n ... | {
"fields": [
{
"declarator": "classLoader",
"modifier": "private static",
"original_string": "private static ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "mapper = new ObjectMapper()",
"modifier": "private static"... | {
"body": "@GET\n @Path(\"getBasesetNameList\")\n @Produces(MediaType.APPLICATION_JSON)\n public Status getBasesetNameList(@QueryParam(\"groupId\") int groupId) {\n try {\n Status status = Status.OK();\n List<DalGroupDB> dalGroupDBS = BeanGetter.getDaoOfDalGroupDB().getDalCluster... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_73 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testColumns() {\n AbstractFreeSqlBuilder test = create();\n test.append(columns(template, template, template));\n assertEquals(\"[template] [template] [template]\", test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilderTest.testColumns()",
... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static ClauseList columns(String... names) {\n ClauseList clauses = new ClauseList();\n for (int i = 0; i < names.length; i++) {\n clauses.add(column(names[i]));\n }\n\n return clauses;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.columns(String... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_24 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getTableShardShardColValuedWorkTest() {\n final TableShardContext context = new TableShardContext(\"whatever\");\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7); // ignore\n data1.put(\"age\", 17);\n final ShardData shard... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)",
"constructor": false,
"full_s... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_53 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSqlTaskRequestTest.java",
"identifier": "DalSqlTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetMerger() throws SQLException {\n\t\tDalSqlTaskRequest<Integer> test = null;\n\t\t\n\t\tDalHints hints = new DalHints();\n\t\ttest = new DalSqlTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new TestSqlBuilder(), hints, null, new ResultMerger.IntSummary());\n\t\tassertNotNull(test.get... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private DalLogger logger;",
"type... | {
"body": "@Override\n public ResultMerger<T> getMerger() {\n return merger;\n }",
"class_method_signature": "DalSqlTaskRequest.getMerger()",
"constructor": false,
"full_signature": "@Override public ResultMerger<T> getMerger()",
"identifier": "getMerger",
"invocations": [],
"modifiers": "@Ov... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_184 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalClassScannerTest.java",
"identifier": "DalClassScannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDalClassScanner() {\n ClassScanner scanner = new DalClassScanner(new ClassScanFilter() {\n @Override\n public boolean accept(Class<?> clazz) {\n// return clazz.isAnnotationPresent(Retention.class);\n return !clazz.isInter... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(DalClassScanner.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DalClassScanner.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "public DalClassScanner() {\n this(null, null);\n }",
"class_method_signature": "DalClassScanner.DalClassScanner()",
"constructor": true,
"full_signature": "public DalClassScanner()",
"identifier": "DalClassScanner",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"r... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_12 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getDatabaseCategoryTest() {\n final DatabaseCategory databaseCategory = cluster.getDatabaseCategory();\n Assert.assertEquals(MYSQL, databaseCategory);\n }",
"class_method_signature": "DefaultClusterTest.getDatabaseCategoryTest()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public DatabaseCategory getDatabaseCategory() {\n return clusterConfig.getDatabaseCategory();\n }",
"class_method_signature": "DefaultCluster.getDatabaseCategory()",
"constructor": false,
"full_signature": "@Override public DatabaseCategory getDatabaseCategory()",
"identifi... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_45 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testValidate() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = new DalBulkTaskRequest<>(\"dao_test\", \"\", null, new ArrayList<TestPojo>(), new TestBulkTask());\n\t\ttry {\n\t\t\ttest.validateAndPrepare();\n\t\t} catch (SQLException e) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t\t// Null po... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n\tpublic void validateAndPrepare() throws SQLException {\n\t\tif(null == rawPojos)\n\t\t\tthrow new DalException(ErrorCode.ValidatePojoList);\n\n\t\tif(task == null)\n\t\t\tthrow new DalException(ErrorCode.ValidateTask);\n\n\t\tdbShardMerger = task.createMerger();\n\t\tdaoPojos = task.getPojosFi... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_151 | {
"fields": [
{
"declarator": "logicDbName = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "logicDbName"
}
],
"file": "dal-client/src/test/java/com/c... | {
"body": "@Test\n\tpublic void testGetConnection() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tConnectionAction<?> action = new ConnectionAc... | {
"fields": [
{
"declarator": "connManager",
"modifier": "private",
"original_string": "private DalConnectionManager connManager;",
"type": "DalConnectionManager",
"var_name": "connManager"
},
{
"declarator": "transactionHolder = new ThreadLocal<DalTransaction>()",
... | {
"body": "public DalConnection getConnection(DalHints hints, DalEventEnum operation) throws SQLException {\n return getConnection(hints, false, operation);\n }",
"class_method_signature": "DalTransactionManager.getConnection(DalHints hints, DalEventEnum operation)",
"constructor": false,
"full_signat... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_69 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testText() {\n AbstractFreeSqlBuilder test = create();\n test.append(text(template));\n assertEquals(template, test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilderTest.testText()",
"constructor": false,
"full_signature": "@Test public v... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static Text text(String template) {\n return new Text(template);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.text(String template)",
"constructor": false,
"full_signature": "public static Text text(String template)",
"identifier": "text",
"invocations": [],
"modifie... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_106 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testNotLike() {\n testExpression(wrappedTemplate + \" NOT LIKE ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().notLike(template);\n }\n public AbstractFreeSqlBuilder createExpWithPa... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder notLike(String name) {\n return append(Expressions.notLike(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.notLike(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder notLike(String name)",
"identifier": "notL... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_86 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testWhere() {\n AbstractFreeSqlBuilder test = create();\n test.where();\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"WHERE\", test.build());\n \n test = create();\n test.where(template);\... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder where() {\n return append(WHERE);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.where()",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder where()",
"identifier": "where",
"invocations": [
"append"
],
"modifiers": "pu... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_90 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testGroupBy() {\n AbstractFreeSqlBuilder test = create();\n test.groupBy(template);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"GROUP BY \" + wrappedTemplate, test.build());\n \n test = create(... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder groupBy(String name) {\n return append(GROUP_BY).append(column(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.groupBy(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder groupBy(String name)",
"identifier": "... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_110 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testNotIn() {\n String result = wrappedTemplate + \" NOT IN ( ? )\";\n testExpression(result, 1, new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().notIn(template);\n }\n public Abst... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder notIn(String name) {\n return append(Expressions.notIn(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.notIn(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder notIn(String name)",
"identifier": "notIn",
"i... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_28 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void testGetDbShardForNullTable() {\n final DbShardContext assignationShardIdContext = new DbShardContext(\"whatever\").setShardId(0);\n final Integer AssignationShardIdShardIndex = cluster.getDbShard(null, assignationShardIdContext);\n Assert.assertEquals(0, (int) As... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)",
"constructor": false,
"full_signature": "@O... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_147 | {
"fields": [
{
"declarator": "noShardDb = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String noShardDb = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "noShardDb"
},
{
"declarator": "shardDb = \"dao_test_sql... | {
"body": "@Test\n public void testEvaluate() {\n boolean useMaster = true;\n DalHints hints = new DalHints();\n \n try {\n DalConnectionManager test = getDalConnectionManager(noShardDb);\n \n String id = test.evaluateShard(hints);\n assertNul... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private DalConfigure config;",
"type": "DalConfigure",
"var_name": "config"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDb... | {
"body": "public String evaluateShard(DalHints hints) throws SQLException {\n\t\tDatabaseSet dbSet = config.getDatabaseSet(logicDbName);\n\t\tString shardId;\n\n\t\tif(!dbSet.isShardingSupported())\n\t\t\treturn null;\n\n\t\tDalShardingStrategy strategy = dbSet.getStrategy();\n\n\t\tshardId = hints.getShardId();\n\t... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_50 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSqlTaskRequestTest.java",
"identifier": "DalSqlTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testValidate() {\n\t\tDalSqlTaskRequest<Integer> test = null;\n\t\ttry {\n\t\t\ttest = new DalSqlTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new TestSqlBuilder(), new DalHints(), new FreeSqlUpdateTask(), null);\n\t\t\ttest.validateAndPrepare();\n\t\t} catch (SQLException e) {\n\t\t\tfai... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private DalLogger logger;",
"type... | {
"body": "@Override\n public void validateAndPrepare() throws SQLException {\n DalShardingHelper.detectDistributedTransaction(shards);\n taskContext = task.createTaskContext();\n }",
"class_method_signature": "DalSqlTaskRequest.validateAndPrepare()",
"constructor": false,
"full_signature": ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_187 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalSingleResultMergerTest.java",
"identifier": "DalSingleResultMergerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testAddPartial(){\n\t\tDalSingleResultMerger<Object> test = new DalSingleResultMerger<>();\n\t\ttry {\n\t\t\ttest.addPartial(\"\", null);\n\t\t\ttest.addPartial(\"\", new Object());\n\t\t} catch (SQLException e1) {\n\t\t\tAssert.fail();\n\t\t}\n\t\ttry {\n\t\t\ttest.addPartial(\"\", ne... | {
"fields": [
{
"declarator": "result",
"modifier": "private",
"original_string": "private T result;",
"type": "T",
"var_name": "result"
}
],
"file": "dal-client/src/main/java/com/ctrip/platform/dal/dao/helper/DalSingleResultMerger.java",
"identifier": "DalSingleResultMerge... | {
"body": "@Override\n\tpublic void addPartial(String shard, T partial) throws SQLException {\n\t\tif(partial == null)\n\t\t\treturn;\n\t\t\n\t\tif(result == null)\n\t\t\tresult = partial;\n\t\telse\n\t\t\tthrow new DalException(ErrorCode.AssertSingle);\n\t}",
"class_method_signature": "DalSingleResultMerger.addPar... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_168 | {
"fields": [
{
"declarator": "executor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.SECONDS,\n new LinkedBlockingQueue<Runnable>(), new CustomThreadFactory(\"RefreshableDataSourceTest\"))",
"modifier": "private",
"original_string": "private ExecutorService executor = new ThreadPoolEx... | {
"body": "@Test\n public void testReusedSingleDataSource() {\n Properties p1 = new Properties();\n p1.setProperty(\"userName\", \"root\");\n p1.setProperty(\"password\", \"!QAZ@WSX1qaz2wsx\");\n p1.setProperty(\"connectionUrl\", \"jdbc:mysql://10.32.20.128:3306/llj_test?useUnicode=true... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static",
"original_string": "private static ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declarator": "dataS... | {
"body": "@Override\n public SingleDataSource getSingleDataSource() {\n return dataSourceReference.get();\n }",
"class_method_signature": "RefreshableDataSource.getSingleDataSource()",
"constructor": false,
"full_signature": "@Override public SingleDataSource getSingleDataSource()",
"identifier"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_11 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getClusterNameTest() {\n final String clusterName = cluster.getClusterName();\n Assert.assertEquals(\"demo-cluster\", clusterName);\n }",
"class_method_signature": "DefaultClusterTest.getClusterNameTest()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public String getClusterName() {\n return clusterConfig.getClusterName();\n }",
"class_method_signature": "DefaultCluster.getClusterName()",
"constructor": false,
"full_signature": "@Override public String getClusterName()",
"identifier": "getClusterName",
"invocations": ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_46 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsCrossShard() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = null;\n\t\tList<TestPojo> pojos = null;\n\t\ttry {\n\t\t\t// Already sharded\n\t\t\ttest = new DalBulkTaskRequest<>(\"dao_test_sqlsvr_dbShard\", \"\", new DalHints().inShard(1), new ArrayList<TestPojo>(), new TestBu... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n\tpublic boolean isCrossShard() throws SQLException {\t\t\n\t\tif(isAlreadySharded(logicDbName, rawTableName, hints))\n\t\t\treturn false;\n\t\t\n\t\tif(isShardingEnabled(logicDbName)) {\n\t\t\tshuffled = shuffle(logicDbName, hints.getShardId(), daoPojos, hints);\n\t\t\t// Only in one or no shar... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_129 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSetTemplate() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n test.setTemplate(template);\n assertEquals(template, test.build());\n }",
"class_method_signature": "FreeUpdateSqlBuilderTest.testSetTemplate()",
"constructor": false,
... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder setTemplate(String updateSqlTemplate) {\n\t\tappend(updateSqlTemplate);\n\t\treturn this;\n\t}",
"class_method_signature": "FreeUpdateSqlBuilder.setTemplate(String updateSqlTemplate)",
"constructor": false,
"full_signature": "public FreeUpdateSqlBuilder setTemplate(String ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_152 | {
"fields": [
{
"declarator": "logicDbName = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "logicDbName"
}
],
"file": "dal-client/src/test/java/com/c... | {
"body": "@Test\n\tpublic void testGetCurrentDbMeta() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tConnectionAction<?> action = new Connectio... | {
"fields": [
{
"declarator": "connManager",
"modifier": "private",
"original_string": "private DalConnectionManager connManager;",
"type": "DalConnectionManager",
"var_name": "connManager"
},
{
"declarator": "transactionHolder = new ThreadLocal<DalTransaction>()",
... | {
"body": "public static DbMeta getCurrentDbMeta() {\n return isInTransaction() ? transactionHolder.get().getConnection().getMeta() : null;\n }",
"class_method_signature": "DalTransactionManager.getCurrentDbMeta()",
"constructor": false,
"full_signature": "public static DbMeta getCurrentDbMeta()",
"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_105 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testLike() {\n testExpression(wrappedTemplate + \" LIKE ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().like(template);\n }\n public AbstractFreeSqlBuilder createExpWithParameter() ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder like(String name) {\n return append(Expressions.like(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.like(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder like(String name)",
"identifier": "like",
"invoca... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_85 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testFrom() {\n String noShardTable = \"noShard\";\n \n AbstractFreeSqlBuilder test = create();\n test.from(noShardTable);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"FROM [noShard] WITH (NOLOCK... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder from(String table) {\n return from(table(table));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.from(String table)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder from(String table)",
"identifier": "from",
"invocations": [... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_93 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testRightBracket() {\n AbstractFreeSqlBuilder test = create();\n test.rightBracket();\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\")\", test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuil... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder rightBracket() {\n return append(Expressions.rightBracket);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.rightBracket()",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder rightBracket()",
"identifier": "rightBracket",
"invoc... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_113 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSetTemplate() throws SQLException {\n FreeSelectSqlBuilder test = createTest();\n test.setTemplate(template).setTemplate(template);\n assertEquals(template+\" \" + template, test.build());\n }",
"class_method_signature": "FreeSelectSqlBuilderTest.testSet... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@SuppressWarnings(\"rawtypes\")\n private",
"original_string": "@SuppressWarnings(\"rawtypes\")\n private DalRowMapper mapper;",
"type": "DalRowMapper",
"var_name": "mapper"
},
{
"declarator": "merger",
"m... | {
"body": "public FreeSelectSqlBuilder<K> setTemplate(String selectSqlTemplate) {\n append(selectSqlTemplate);\n return this;\n }",
"class_method_signature": "FreeSelectSqlBuilder.setTemplate(String selectSqlTemplate)",
"constructor": false,
"full_signature": "public FreeSelectSqlBuilder<K> set... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_144 | {
"fields": [
{
"declarator": "connectionString = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String connectionString = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "connectionString"
}
],
"file": "dal-client/src/... | {
"body": "@Test\n public void testEnd() {\n TestConnectionAction test = new TestConnectionAction();\n test.initLogEntry(connectionString, new DalHints());\n test.start();\n Object result = null;\n Throwable e = null;\n try {\n Thread.sleep(10l);\n te... | {
"fields": [
{
"declarator": "envUtils = DalElementFactory.DEFAULT.getEnvUtils()",
"modifier": "private static final",
"original_string": "private static final EnvUtils envUtils = DalElementFactory.DEFAULT.getEnvUtils();",
"type": "EnvUtils",
"var_name": "envUtils"
},
{
... | {
"body": "public void end(Object result) throws SQLException {\n log(result, e);\n handleException(e);\n }",
"class_method_signature": "ConnectionAction.end(Object result)",
"constructor": false,
"full_signature": "public void end(Object result)",
"identifier": "end",
"invocations": [
... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_133 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testDeleteFromMeltdown() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.deleteFrom(noShardTableName);\n test.where().and(template ,template, template);\n assertEquals(\"DELETE FROM \" + wrappedNoShardTableName + \" WHERE templat... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder deleteFrom(String tableName) {\n return deleteFrom(table(tableName));\n }",
"class_method_signature": "FreeUpdateSqlBuilder.deleteFrom(String tableName)",
"constructor": false,
"full_signature": "public FreeUpdateSqlBuilder deleteFrom(String tableName)",
"ident... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_164 | {
"fields": [
{
"declarator": "connectionString = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String connectionString = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "connectionString"
}
],
"file": "dal-client/src/... | {
"body": "@Test\n\tpublic void testClose() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\n\t\t\tStatement statement = test.getConn().createStatement();\n\t\t\tResultSet rs = statement.executeQuery(\"select * from \" + SqlServerTestInitializer.TABLE_NAME)... | {
"fields": [
{
"declarator": "oldIsolationLevel",
"modifier": "private",
"original_string": "private Integer oldIsolationLevel;",
"type": "Integer",
"var_name": "oldIsolationLevel"
},
{
"declarator": "newIsolationLevel",
"modifier": "private",
"original_str... | {
"body": "public void close() {\n try {\n if (conn == null || conn.isClosed())\n return;\n } catch (Throwable e) {\n logger.error(\"Restore connection isolation level failed!\", e);\n }\n\n try {\n if (newIsolationLevel != null)\n ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_172 | {
"fields": [
{
"declarator": "random = new Random()",
"modifier": "private",
"original_string": "private Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "dbName = \"dao_test\"",
"modifier": "private",
"original_stri... | {
"body": "@Test\n\tpublic void countBaseLineMatchButOverdueTest() {\n\t\tTimeoutDetector detector = new TimeoutDetector();\n\t\tDalStatusManager.getTimeoutMarkdown().setEnabled(true);\n\t\tDalStatusManager.getTimeoutMarkdown().setErrorCountThreshold(5);\n\t\tDalStatusManager.getTimeoutMarkdown().setSamplingDuration(... | {
"fields": [
{
"declarator": "data = new ConcurrentHashMap<String, DetectorCounter>()",
"modifier": "private",
"original_string": "private Map<String, DetectorCounter> data = new ConcurrentHashMap<String, DetectorCounter>();",
"type": "Map<String, DetectorCounter>",
"var_name": "dat... | {
"body": "@Override\n\tpublic void detect(ErrorContext ctx) {\t\n\t\tTimeoutMarkdown tmb = DalStatusManager.getTimeoutMarkdown();\n\n\t\tif(!tmb.isEnabled())\n\t\t\treturn;\n\n\t\tlong duration = tmb.getSamplingDuration() * 1000 + 10;\n\t\tif(!data.containsKey(ctx.getName()))\n\t\t\tdata.put(ctx.getName(), new Detec... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_125 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testLike() throws SQLException {\n Clause test = like(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" LIKE ?\", test.build());\n }",
"class_method_signature": "ExpressionsTest.testLike()",
"constructor": false,
"full_signature": "@Test p... | {
"fields": [
{
"declarator": "NULL = new NullExpression()",
"modifier": "public static final",
"original_string": "public static final NullExpression NULL = new NullExpression();",
"type": "NullExpression",
"var_name": "NULL"
},
{
"declarator": "TRUE = new ImmutableExp... | {
"body": "public static ColumnExpression like(String name) {\n return columnExpression(\"%s LIKE ?\", name);\n }",
"class_method_signature": "Expressions.like(String name)",
"constructor": false,
"full_signature": "public static ColumnExpression like(String name)",
"identifier": "like",
"invocati... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_31 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/LocalDatabaseSetAdapterTest.java",
"identifier": "LocalDatabaseSetAdapterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAdapt() throws Exception {\n LocalDatabaseSetAdapter adapter = new LocalDatabaseSetAdapter(mockConnectionStrings());\n DatabaseSet set1 = mockDatabaseSet(\"set1\", \"set1-db1\", \"set1-db2\");\n DatabaseSet set1Adapted = adapter.adapt(set1);\n Assert.a... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static final",
"original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "@Override\n public DatabaseSet adapt(DatabaseSet original) {\n if (connectionStrings == null || connectionStrings.isEmpty())\n return original;\n if (original instanceof DefaultDatabaseSet) {\n try {\n boolean dbShardingDisabled = true;\n ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_89 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testOrderBy() {\n AbstractFreeSqlBuilder test = create();\n test.orderBy(template, true);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"ORDER BY \" + wrappedTemplate + \" ASC\", test.build());\n }",
"clas... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder orderBy(String name, boolean ascending) {\n return append(ORDER_BY).append(column(name)).appendWhen(ascending, ASC, DESC);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.orderBy(String name, boolean ascending)",
"constructor": false,
"full_signature": ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_109 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testIn() {\n String result = wrappedTemplate + \" IN ( ? )\";\n testExpression(result, 1, new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().in(template);\n }\n public AbstractFreeSq... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder in(String name) {\n return append(Expressions.in(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.in(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder in(String name)",
"identifier": "in",
"invocations": [
... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_0 | {
"fields": [
{
"declarator": "fileResource",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private FileResource fileResource;",
"type": "FileResource",
"var_name": "fileResource"
},
{
"declarator": "bufferedReader",
"modifier": "@... | {
"body": "@Test\n public void isDalCluster() {\n assertEquals(true, fileResource.isDalCluster(\"bbz_dalcluster\"));\n assertEquals(false, fileResource.isDalCluster(\"clustername\"));\n }",
"class_method_signature": "FileResourceTest.isDalCluster()",
"constructor": false,
"full_signature": "... | {
"fields": [
{
"declarator": "generatePath",
"modifier": "private static",
"original_string": "private static String generatePath;",
"type": "String",
"var_name": "generatePath"
}
],
"file": "dal-dao-gen/src/main/java/com/ctrip/platform/dal/daogen/resource/FileResource.java"... | {
"body": "public boolean isDalCluster(String clusterName) {\n int length = clusterName.length();\n return length > 11 && \"_dalcluster\".equals(clusterName.substring(length - 11));\n }",
"class_method_signature": "FileResource.isDalCluster(String clusterName)",
"constructor": false,
"full_sign... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_66 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSetLogicDbName() {\n AbstractFreeSqlBuilder test = create();\n try {\n test.setLogicDbName(null);\n fail();\n } catch (Exception e) {\n }\n \n try {\n test.setLogicDbName(\"Not exist\");\n fail(... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder setLogicDbName(String logicDbName) {\n context.setLogicDbName(logicDbName);\n return this;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.setLogicDbName(String logicDbName)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_70 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testTexts() {\n AbstractFreeSqlBuilder test = create();\n test.append(texts(template, template));\n assertEquals(template+ \" \" + template, test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilderTest.testTexts()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static ClauseList texts(String... templates) {\n ClauseList clauses = new ClauseList();\n for (int i = 0; i < templates.length; i++) {\n clauses.add(text(templates[i]));\n }\n\n return clauses;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.texts(... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_148 | {
"fields": [
{
"declarator": "noShardDb = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String noShardDb = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "noShardDb"
},
{
"declarator": "shardDb = \"dao_test_sql... | {
"body": "@Test\n\tpublic void testDoInConnection() {\n\t\tfinal boolean useMaster = true;\n\t\tfinal DalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\tfinal DalConnectionManager test = getDalConnectionManager(noShardDb);\n\t\t\tConnectionAction<Object> action = new ConnectionAction<Object>() {\n\t\t\t\tpubli... | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private DalConfigure config;",
"type": "DalConfigure",
"var_name": "config"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDb... | {
"body": "public <T> T doInConnection(ConnectionAction<T> action, DalHints hints)\n\t\t\tthrows SQLException {\n\t\t// If HA disabled or not query, we just directly call _doInConnnection\n\n\t\tif(!DalStatusManager.getHaStatus().isEnabled()\n\t\t\t\t|| action.operation != DalEventEnum.QUERY)\n\t\t\treturn _doInConne... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_27 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getTableShardSeparatorTest() {\n final String table14Separator = cluster.getTableShardSeparator(\"table14\");\n Assert.assertEquals(\"_\", table14Separator);\n final String table15Separator = cluster.getTableShardSeparator(\"table15\");\n Assert.assertEqua... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public String getTableShardSeparator(String tableName) {\n return shardStrategyProxy.getTableShardSeparator(tableName);\n }",
"class_method_signature": "DefaultCluster.getTableShardSeparator(String tableName)",
"constructor": false,
"full_signature": "@Override public String ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_149 | {
"fields": [
{
"declarator": "logicDbName = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "logicDbName"
}
],
"file": "dal-client/src/test/java/com/c... | {
"body": "@Test\n\tpublic void testDalTransactionManager() {\n\t\ttry {\n\t\t\tDalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"class_method_signature": "DalTransactionManagerTest.testDalTransac... | {
"fields": [
{
"declarator": "connManager",
"modifier": "private",
"original_string": "private DalConnectionManager connManager;",
"type": "DalConnectionManager",
"var_name": "connManager"
},
{
"declarator": "transactionHolder = new ThreadLocal<DalTransaction>()",
... | {
"body": "public DalTransactionManager(DalConnectionManager connManager) {\n this.connManager = connManager;\n }",
"class_method_signature": "DalTransactionManager.DalTransactionManager(DalConnectionManager connManager)",
"constructor": true,
"full_signature": "public DalTransactionManager(DalConnec... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_26 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void getAllTableShardTest() {\n final Set<String> expected = new HashSet<>();\n expected.add(\"0\");\n expected.add(\"1\");\n expected.add(\"2\");\n final Set<String> table15 = cluster.getAllTableShards(\"table15\");\n Assert.assertEquals(expected... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public Set<String> getAllTableShards(String tableName) {\n return shardStrategyProxy.getAllTableShards(tableName);\n }",
"class_method_signature": "DefaultCluster.getAllTableShards(String tableName)",
"constructor": false,
"full_signature": "@Override public Set<String> getAl... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_71 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testKeyword() {\n AbstractFreeSqlBuilder test = create();\n test.append(keyword(template));\n assertEquals(template, test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilderTest.testKeyword()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static Keyword keyword(String keyword) {\n return new Keyword(keyword);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.keyword(String keyword)",
"constructor": false,
"full_signature": "public static Keyword keyword(String keyword)",
"identifier": "keyword",
"invocations... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_88 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testExcludeAll() {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n test.select(template).from(template).where(AbstractFreeSqlBuilder.excludeAll()).equal(template);\n assertEquals(\"SELECT [template] FROM ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public static Clause excludeAll() {\n return new ClauseList().add(Expressions.expression(\"1<>1\"), Expressions.OR);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.excludeAll()",
"constructor": false,
"full_signature": "public static Clause excludeAll()",
"identifier": "excludeAl... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_108 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testNotBetween() {\n String result = wrappedTemplate + \" NOT BETWEEN ? AND ?\";\n testExpression(result, 2, new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().notBetween(template);\n }\n ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder notBetween(String name) {\n return append(Expressions.notBetween(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.notBetween(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder notBetween(String name)",
"identi... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_1 | {
"fields": [
{
"declarator": "fileResource",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private FileResource fileResource;",
"type": "FileResource",
"var_name": "fileResource"
},
{
"declarator": "bufferedReader",
"modifier": "@... | {
"body": "@Test\n public void getClusterDatabaseSetTest() throws IOException {\n String s = \"\\t\\t<databaseSet name=\\\"corporderprocesslogshardbasedb_dalcluster\\\" provider=\\\"sqlserver\\\"/>\";\n String s1 = \"\\t\\t<databasseSet name=\\\"corporderprocesslogshardbasedb_dalcluster\\\" provider=... | {
"fields": [
{
"declarator": "generatePath",
"modifier": "private static",
"original_string": "private static String generatePath;",
"type": "String",
"var_name": "generatePath"
}
],
"file": "dal-dao-gen/src/main/java/com/ctrip/platform/dal/daogen/resource/FileResource.java"... | {
"body": "public String getClusterDatabaseSet(String conf, BufferedReader reader) throws IOException {\n int nameStartIndex = conf.indexOf(\"\\\"\");\n int nameEndIndex = conf.indexOf(\"\\\"\", nameStartIndex + 1);\n if (conf.startsWith(\"\\t\\t<databaseSet\") && isDalCluster(conf.substring(name... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_67 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSetHints() {\n AbstractFreeSqlBuilder test = create();\n try {\n test.setHints(null);\n fail();\n } catch (Exception e) {\n }\n \n test.setHints(new DalHints());\n }",
"class_method_signature": "AbstractFreeSqlB... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder setHints(DalHints hints) {\n context.setHints(hints);\n return this;\n }",
"class_method_signature": "AbstractFreeSqlBuilder.setHints(DalHints hints)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder setHints(DalHints hints)",
"i... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_30 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private static",
"original_string": "private static Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
}
],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe... | {
"body": "@Test\n public void testGetDbShardForStringColumn() {\n String testString = \"dal-cluster-test\";\n int testLong = testString.hashCode();\n\n final DbShardContext assignationShardValueContext = new DbShardContext(\"whatever\");\n assignationShardValueContext.setShardValue(tes... | {
"fields": [
{
"declarator": "clusterConfig",
"modifier": "private",
"original_string": "private ClusterConfigImpl clusterConfig;",
"type": "ClusterConfigImpl",
"var_name": "clusterConfig"
},
{
"declarator": "databaseShards = new HashMap<>()",
"modifier": "privat... | {
"body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }",
"class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)",
"constructor": false,
"full_signature": "@O... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_124 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testBetween() throws SQLException {\n Clause test = between(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" BETWEEN ? AND ?\", test.build());\n }",
"class_method_signature": "ExpressionsTest.testBetween()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "NULL = new NullExpression()",
"modifier": "public static final",
"original_string": "public static final NullExpression NULL = new NullExpression();",
"type": "NullExpression",
"var_name": "NULL"
},
{
"declarator": "TRUE = new ImmutableExp... | {
"body": "public static BetweenExpression between(String name) {\n return new BetweenExpression(name);\n }",
"class_method_signature": "Expressions.between(String name)",
"constructor": false,
"full_signature": "public static BetweenExpression between(String name)",
"identifier": "between",
"invo... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_173 | {
"fields": [
{
"declarator": "random = new Random()",
"modifier": "private",
"original_string": "private Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "dbName = \"dao_test\"",
"modifier": "private",
"original_stri... | {
"body": "@Test\n\tpublic void errorPercentMatchTest(){\n\t\tTimeoutDetector detector = new TimeoutDetector();\n\t\tDalStatusManager.getTimeoutMarkdown().setEnabled(true);\n\t\tDalStatusManager.getMarkdownStatus().setEnableAutoMarkdown(true);\n\t\tDalStatusManager.getTimeoutMarkdown().setErrorPercentReferCount(10);\... | {
"fields": [
{
"declarator": "data = new ConcurrentHashMap<String, DetectorCounter>()",
"modifier": "private",
"original_string": "private Map<String, DetectorCounter> data = new ConcurrentHashMap<String, DetectorCounter>();",
"type": "Map<String, DetectorCounter>",
"var_name": "dat... | {
"body": "@Override\n\tpublic void detect(ErrorContext ctx) {\t\n\t\tTimeoutMarkdown tmb = DalStatusManager.getTimeoutMarkdown();\n\n\t\tif(!tmb.isEnabled())\n\t\t\treturn;\n\n\t\tlong duration = tmb.getSamplingDuration() * 1000 + 10;\n\t\tif(!data.containsKey(ctx.getName()))\n\t\t\tdata.put(ctx.getName(), new Detec... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_165 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/client/LogEntryTest.java",
"identifier": "LogEntryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetCallerInShort() {\n LogEntry test = new LogEntry();\n\n assertEquals(\"NativeMethodAccessorImpl.invoke\", test.getCallerInShort());\n }",
"class_method_signature": "LogEntryTest.testGetCallerInShort()",
"constructor": false,
"full_signature": "@Test publ... | {
"fields": [
{
"declarator": "currentCaller",
"modifier": "private static volatile",
"original_string": "private static volatile ThreadLocal<String> currentCaller;",
"type": "ThreadLocal<String>",
"var_name": "currentCaller"
},
{
"declarator": "execludedPackageSpace = ... | {
"body": "public String getCallerInShort() {\n\t try {\n String caller = getCaller();\n int lastIndex = caller.lastIndexOf('.');\n \n lastIndex = caller.lastIndexOf('.', lastIndex - 1);\n return caller.substring(lastIndex + 1);\n } catch (Throwable e) ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_132 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testDeleteFrom() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.deleteFrom(noShardTableName);\n assertEquals(\"DELETE FROM \" + wrappedNoShardTableName, test.build());\n \n test = createTest();\n\n test.deleteFrom(... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder deleteFrom(String tableName) {\n return deleteFrom(table(tableName));\n }",
"class_method_signature": "FreeUpdateSqlBuilder.deleteFrom(String tableName)",
"constructor": false,
"full_signature": "public FreeUpdateSqlBuilder deleteFrom(String tableName)",
"ident... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_145 | {
"fields": [
{
"declarator": "connectionString = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String connectionString = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "connectionString"
}
],
"file": "dal-client/src/... | {
"body": "@Test\n public void testCleanup() {\n try {\n TestConnectionAction test = new TestConnectionAction();\n test.connHolder = getDalConnection();\n test.statement = test.connHolder.getConn().createStatement();\n test.rs = test.statement.executeQuery(\"selec... | {
"fields": [
{
"declarator": "envUtils = DalElementFactory.DEFAULT.getEnvUtils()",
"modifier": "private static final",
"original_string": "private static final EnvUtils envUtils = DalElementFactory.DEFAULT.getEnvUtils();",
"type": "EnvUtils",
"var_name": "envUtils"
},
{
... | {
"body": "public void cleanup() {\n closeResultSet();\n closeStatement();\n closeConnection();\n }",
"class_method_signature": "ConnectionAction.cleanup()",
"constructor": false,
"full_signature": "public void cleanup()",
"identifier": "cleanup",
"invocations": [
"closeResultSet... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_92 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testLeftBracket() {\n AbstractFreeSqlBuilder test = create();\n test.leftBracket();\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"(\", test.build());\n }",
"class_method_signature": "AbstractFreeSqlBuilde... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder leftBracket() {\n return append(Expressions.leftBracket);\n }",
"class_method_signature": "AbstractFreeSqlBuilder.leftBracket()",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder leftBracket()",
"identifier": "leftBracket",
"invocation... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_112 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testIsNotNull() {\n AbstractFreeSqlBuilder test = create();\n test.isNotNull(template);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(wrappedTemplate + \" IS NOT NULL\", test.build());\n assertEquals(0, t... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder isNotNull(String name) {\n return append(Expressions.isNotNull(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.isNotNull(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder isNotNull(String name)",
"identifier... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_104 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testLessThanEquals() {\n testExpression(wrappedTemplate + \" <= ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().lessThanEquals(template);\n }\n public AbstractFreeSqlBuilder createE... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder lessThanEquals(String name) {\n return append(Expressions.lessThanEquals(name));\n }",
"class_method_signature": "AbstractFreeSqlBuilder.lessThanEquals(String name)",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder lessThanEquals(String n... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_84 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSelectAll() {\n AbstractFreeSqlBuilder test = create();\n test.selectAll();\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"SELECT *\", test.build());\n }",
"class_method_signature": "AbstractFreeSqlBui... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
},
{
"declarator": "PLACE_HOLDER = \"?\"",
"modifier": "public static final",
... | {
"body": "public AbstractFreeSqlBuilder selectAll() {\n return append(SELECT).append(\"*\");\n }",
"class_method_signature": "AbstractFreeSqlBuilder.selectAll()",
"constructor": false,
"full_signature": "public AbstractFreeSqlBuilder selectAll()",
"identifier": "selectAll",
"invocations": [
"... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_153 | {
"fields": [
{
"declarator": "logicDbName = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "logicDbName"
}
],
"file": "dal-client/src/test/java/com/c... | {
"body": "@Test\n\tpublic void testGetLogicDbName() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tassertNull(DalTransactionManager.getLogicDbN... | {
"fields": [
{
"declarator": "connManager",
"modifier": "private",
"original_string": "private DalConnectionManager connManager;",
"type": "DalConnectionManager",
"var_name": "connManager"
},
{
"declarator": "transactionHolder = new ThreadLocal<DalTransaction>()",
... | {
"body": "public static String getLogicDbName() {\n return isInTransaction() ? transactionHolder.get().getLogicDbName() : null;\n }",
"class_method_signature": "DalTransactionManager.getLogicDbName()",
"constructor": false,
"full_signature": "public static String getLogicDbName()",
"identifier": "g... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_47 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalBulkTaskRequestTest.java",
"identifier": "DalBulkTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateTask() {\n\t\tDalBulkTaskRequest<Integer, TestPojo> test = null;\n\t\tList<TestPojo> pojos = null;\n\t\tCallable<Integer> task = null;\n\t\ttry {\n\t\t\t// Empty\n\t\t\tpojos = new ArrayList<TestPojo>();\n\t\t\ttest = new DalBulkTaskRequest<>(\"dao_test_sqlsvr_dbShard\", \"\"... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logicDbName",
"modifier": "private",
"original_string": "private String logicDbName;",
... | {
"body": "@Override\n\tpublic TaskCallable<K> createTask() throws SQLException {\n\t\thints = hints.clone();\n\t\thandleKeyHolder(false);\n\n\t\t// If only one shard is shuffled\n\t\tif(shuffled != null) {\n\t\t\tif(shuffled.size() == 0)\n\t\t\t\treturn new BulkTaskCallable<>(logicDbName, rawTableName, hints, new Ha... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_128 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testNotIn() throws SQLException {\n Clause test = notIn(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" NOT IN ( ? )\", test.build());\n }",
"class_method_signature": "ExpressionsTest.testNotIn()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "NULL = new NullExpression()",
"modifier": "public static final",
"original_string": "public static final NullExpression NULL = new NullExpression();",
"type": "NullExpression",
"var_name": "NULL"
},
{
"declarator": "TRUE = new ImmutableExp... | {
"body": "public static ColumnExpression notIn(String name) {\n return new NotInExpression(name);\n }",
"class_method_signature": "Expressions.notIn(String name)",
"constructor": false,
"full_signature": "public static ColumnExpression notIn(String name)",
"identifier": "notIn",
"invocations": []... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_10 | {
"fields": [],
"file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/util/ObjectHolderTest.java",
"identifier": "ObjectHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testObjectHolder() {\n ObjectHolder<Object> holder = new ObjectHolder<>();\n\n Assert.assertNull(holder.get());\n Assert.assertNull(holder.getAndSet(new Object()));\n Assert.assertNotNull(holder.get());\n holder.set(null);\n Assert.assertNull... | {
"fields": [
{
"declarator": "objectRef",
"modifier": "private final",
"original_string": "private final AtomicReference<T> objectRef;",
"type": "AtomicReference<T>",
"var_name": "objectRef"
}
],
"file": "dal-cluster-client/src/main/java/com/ctrip/framework/dal/cluster/clien... | {
"body": "public ObjectHolder() {\n objectRef = new AtomicReference<>();\n }",
"class_method_signature": "ObjectHolder.ObjectHolder()",
"constructor": true,
"full_signature": "public ObjectHolder()",
"identifier": "ObjectHolder",
"invocations": [],
"modifiers": "public",
"parameters": "()",
... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_186 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalBase64Test.java",
"identifier": "DalBase64Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void decodeBase64() throws Exception {\n String someSeeds = \"123456abcdef,.!@#$\";\n\n checkDecode(generateString(someSeeds, 5));\n checkDecode(generateString(someSeeds, 10));\n checkDecode(generateString(someSeeds, 50));\n checkDecode(generateString(so... | {
"fields": [
{
"declarator": "CHUNK_SEPARATOR = {'\\r', '\\n'}",
"modifier": "static final",
"original_string": "static final byte[] CHUNK_SEPARATOR = {'\\r', '\\n'};",
"type": "byte[]",
"var_name": "CHUNK_SEPARATOR"
}
],
"file": "dal-client/src/main/java/com/ctrip/platform/... | {
"body": "public static byte[] decodeBase64(final byte[] base64Data) {\n return new DalBase64().decode(base64Data);\n }",
"class_method_signature": "DalBase64.decodeBase64(final byte[] base64Data)",
"constructor": false,
"full_signature": "public static byte[] decodeBase64(final byte[] base64Data)",
... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_169 | {
"fields": [
{
"declarator": "properties = new Properties()",
"modifier": "private",
"original_string": "private Properties properties = new Properties();",
"type": "Properties",
"var_name": "properties"
},
{
"declarator": "dataSource = null",
"modifier": "privat... | {
"body": "@Test\n public void testStatementExecuteQuery() throws Exception {\n Statement statement = connection.createStatement();\n statement.executeQuery(\"select 1\");\n\n Assert.assertEquals(dataSource.getFirstAppearContinuousErrorTime(), 0);\n Assert.assertEquals(dataSource.getLas... | {
"fields": [
{
"declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()",
"modifier": "private static final",
"original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();",
"type": "ILogger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "@Override\n public ResultSet executeQuery(String sql) throws SQLException {\n return executeStatement(() -> statement.executeQuery(sql), false);\n }",
"class_method_signature": "DalStatement.executeQuery(String sql)",
"constructor": false,
"full_signature": "@Override public ResultSet ex... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_51 | {
"fields": [],
"file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSqlTaskRequestTest.java",
"identifier": "DalSqlTaskRequestTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsCrossShard() throws SQLException {\n\t\tDalSqlTaskRequest<Integer> test = null;\n\t\t\n\t\tDalHints hints = new DalHints();\n\t\ttest = new DalSqlTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new TestSqlBuilder(), hints, null, null);\n\t\tassertFalse(test.isCrossShard());\n\t\t\t\n\... | {
"fields": [
{
"declarator": "caller",
"modifier": "private",
"original_string": "private String caller;",
"type": "String",
"var_name": "caller"
},
{
"declarator": "logger",
"modifier": "private",
"original_string": "private DalLogger logger;",
"type... | {
"body": "@Override\n public boolean isCrossShard() {\n return (shards != null && shards.size() > 1);\n }",
"class_method_signature": "DalSqlTaskRequest.isCrossShard()",
"constructor": false,
"full_signature": "@Override public boolean isCrossShard()",
"identifier": "isCrossShard",
"invocation... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_135 | {
"fields": [
{
"declarator": "template = \"template\"",
"modifier": "private static final",
"original_string": "private static final String template = \"template\";",
"type": "String",
"var_name": "template"
},
{
"declarator": "wrappedTemplate = \"[template]\"",
... | {
"body": "@Test\n public void testSet() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.set(template, tableName, noShardTableName);\n assertEquals(\"SET [template]=?, [dal_client_test]=?, [noShard]=?\", test.build());\n \n test = createTest();\n\n ... | {
"fields": [
{
"declarator": "INSERT_INTO = \"INSERT INTO\"",
"modifier": "public static final",
"original_string": "public static final String INSERT_INTO = \"INSERT INTO\";",
"type": "String",
"var_name": "INSERT_INTO"
},
{
"declarator": "VALUES = \"VALUES\"",
... | {
"body": "public FreeUpdateSqlBuilder set(String...columnNames) {\n append(SET);\n for (int i = 0; i < columnNames.length; i++) {\n append(Expressions.columnExpression(\"%s=?\", columnNames[i]));\n if(i != columnNames.length -1)\n append(COMMA);\n }\n ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_162 | {
"fields": [
{
"declarator": "connectionString = \"dao_test_sqlsvr\"",
"modifier": "private static final",
"original_string": "private static final String connectionString = \"dao_test_sqlsvr\";",
"type": "String",
"var_name": "connectionString"
}
],
"file": "dal-client/src/... | {
"body": "@Test\n\tpublic void testSetAutoCommit() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\t\t\ttest.setAutoCommit(false);\n\t\t\tconn = test.getConn();\n\t\t\tassertFalse(conn.getAutoCommit());\n\t\t\ttest.setAutoCommit(true);\n\t\t\tassertTrue(co... | {
"fields": [
{
"declarator": "oldIsolationLevel",
"modifier": "private",
"original_string": "private Integer oldIsolationLevel;",
"type": "Integer",
"var_name": "oldIsolationLevel"
},
{
"declarator": "newIsolationLevel",
"modifier": "private",
"original_str... | {
"body": "public void setAutoCommit(boolean autoCommit) throws SQLException {\n if (conn.getAutoCommit() != autoCommit)\n conn.setAutoCommit(autoCommit);\n }",
"class_method_signature": "DalConnection.setAutoCommit(boolean autoCommit)",
"constructor": false,
"full_signature": "public void ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
64185596_174 | {
"fields": [
{
"declarator": "random = new Random()",
"modifier": "private",
"original_string": "private Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "dbName = \"dao_test\"",
"modifier": "private",
"original_stri... | {
"body": "@Test\n\tpublic void isTimeOutExceptionTest(){\n\t\tDatabaseCategory ct = DatabaseCategory.MySql;\n\t\tSQLException e = this.mockTimeoutException(ct);\n\t\tErrorContext ctx = new ErrorContext(dbName, ct, 10000, e);\n\t\tAssert.assertTrue(TimeoutDetector.isTimeOutException(ctx));\n\t\t\n\t\tct = DatabaseCat... | {
"fields": [
{
"declarator": "data = new ConcurrentHashMap<String, DetectorCounter>()",
"modifier": "private",
"original_string": "private Map<String, DetectorCounter> data = new ConcurrentHashMap<String, DetectorCounter>();",
"type": "Map<String, DetectorCounter>",
"var_name": "dat... | {
"body": "public static boolean isTimeOutException(ErrorContext ctx){\n\t\treturn ctx.getDbCategory().isTimeOutException(ctx);\n\t}",
"class_method_signature": "TimeoutDetector.isTimeOutException(ErrorContext ctx)",
"constructor": false,
"full_signature": "public static boolean isTimeOutException(ErrorContext ... | {
"created": "7/26/2016 3:07:03 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 64185596,
"size": null,
"stargazer_count": null,
"stars": 1054,
"updates": "2020-01-19T21:20:53+00:00",
"url": "https://github.com/ctripcorp/dal"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.