Search in sources :

Example 11 with SqlPlaceholdersWrapper

use of com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper in project sql-boot by sql-boot.

the class TableJdbcResourceTypeTest method read.

@Test
public void read() {
    final ResourceType table = new TableJdbcResourceType(dataSource);
    final Stream<DbResource> tables = table.read(new SqlPlaceholdersWrapper(new DbUri("table", asList("*"))));
    assertEquals(2, tables.count());
}
Also used : SqlPlaceholdersWrapper(com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper) DbUri(com.github.mgramin.sqlboot.model.uri.impl.DbUri) DbResource(com.github.mgramin.sqlboot.model.resource.DbResource) ResourceType(com.github.mgramin.sqlboot.model.resource_type.ResourceType) Test(org.junit.Test)

Example 12 with SqlPlaceholdersWrapper

use of com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper in project sql-boot by sql-boot.

the class FkJdbcResourceTypeTest method read.

@Test
public void read() {
    final ResourceType fk = new FkJdbcResourceType(dataSource);
    final Stream<DbResource> foreignKeys = fk.read(new SqlPlaceholdersWrapper(new DbUri("fk", asList("*"))));
    assertEquals(1, foreignKeys.count());
}
Also used : SqlPlaceholdersWrapper(com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper) DbUri(com.github.mgramin.sqlboot.model.uri.impl.DbUri) DbResource(com.github.mgramin.sqlboot.model.resource.DbResource) ResourceType(com.github.mgramin.sqlboot.model.resource_type.ResourceType) Test(org.junit.Test)

Example 13 with SqlPlaceholdersWrapper

use of com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper in project sql-boot by sql-boot.

the class ChildTableJdbcResourceTypeTest method read.

@Test
public void read() {
    final ResourceType pk = new ChildTableJdbcResourceType(dataSource);
    final Stream<DbResource> primaryKeys = pk.read(new SqlPlaceholdersWrapper(new DbUri("child_table", asList("*"))));
    assertEquals(1, primaryKeys.count());
}
Also used : SqlPlaceholdersWrapper(com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper) DbUri(com.github.mgramin.sqlboot.model.uri.impl.DbUri) DbResource(com.github.mgramin.sqlboot.model.resource.DbResource) ResourceType(com.github.mgramin.sqlboot.model.resource_type.ResourceType) Test(org.junit.Test)

Aggregations

ResourceType (com.github.mgramin.sqlboot.model.resource_type.ResourceType)13 DbUri (com.github.mgramin.sqlboot.model.uri.impl.DbUri)13 SqlPlaceholdersWrapper (com.github.mgramin.sqlboot.model.uri.wrappers.SqlPlaceholdersWrapper)13 DbResource (com.github.mgramin.sqlboot.model.resource.DbResource)12 Test (org.junit.Test)11 FsResourceTypes (com.github.mgramin.sqlboot.model.resource_type.impl.composite.FsResourceTypes)2 Uri (com.github.mgramin.sqlboot.model.uri.Uri)2 ResponseEntity (org.springframework.http.ResponseEntity)2 ProcedureJdbcResourceType (com.github.mgramin.sqlboot.model.resource_type.impl.jdbc.schema.procedure.ProcedureJdbcResourceType)1 Map (java.util.Map)1 Ignore (org.junit.Ignore)1