Search in sources :

Example 96 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table in project java-bigtable by googleapis.

the class BigtableEmulatorRuleTest method testTableAdminClient.

@Test
public void testTableAdminClient() {
    Table table = tableAdminStub.createTable(CreateTableRequest.newBuilder().setParent("projects/fake-project/instances/fake-instance").setTableId("fake-table").setTable(Table.newBuilder().putColumnFamilies("cf", ColumnFamily.getDefaultInstance())).build());
    assertThat(table.getName()).isEqualTo("projects/fake-project/instances/fake-instance/tables/fake-table");
}
Also used : Table(com.google.bigtable.admin.v2.Table) Test(org.junit.Test)

Example 97 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table in project molgenis-emx2 by molgenis.

the class CrossSchemaReferenceExample method create.

public static void create(Schema schema1, Schema schema2) {
    Table parent = schema1.create(table("Parent", column("name").setPkey(), column("hobby")));
    parent.insert(row("name", "parent1", "hobby", "stamps"));
    Table child = schema2.create(table("Child", column("name").setPkey(), column("parent").setType(REF).setRefSchema(schema1.getName()).setRefTable("Parent")));
    child.insert(row("name", "child1", "parent", "parent1"));
    Table pet = schema1.create(table("Pet", column("name").setPkey(), column("species")));
    pet.insert(row("name", "pooky", "species", "cat"));
    pet.insert(row("name", "spike", "species", "dog"));
    Table petLover = schema2.create(table("PetLover", column("name").setPkey(), column("pets").setType(REF_ARRAY).setRefSchema(schema1.getName()).setRefTable("Pet")));
    petLover.insert(row("name", "x", "pets", new String[] { "pooky", "spike" }));
    Table cat = schema2.create(table("Mouse").setImportSchema(schema1.getName()).setInherit("Pet"));
    cat.insert(row("name", "mickey", "species", "mouse"));
}
Also used : Table(org.molgenis.emx2.Table)

Example 98 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table in project molgenis-emx2 by molgenis.

the class JsonLdExample method create.

public static void create(Schema schema) {
    Table personTable = schema.create(table("Person").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#Person").add(column("name").setPkey().setSemantics("https://schema.org/docs/jsonldcontext.jsonld#name"), column("jobTitle").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#jobTitle").setRequired(true), column("telephone").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#telephone"), column("url").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#url")));
    personTable.insert(row("name", "Jane Doe", "jobTitle", "Professor", "telephone", "(425) 123-4567", "url", "http://www.janedoe.com"), row("id", "2", "name", "Mary Stone", "jobTitle", "Cook"));
    Table recipeTable = schema.create(table("Recipe").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#Recipe").add(column("name").setPkey().setSemantics("https://schema.org/docs/jsonldcontext.jsonld#name"), column("author").setType(REF).setRefTable("Person").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#author").setRequired(true), column("datePublished").setType(DATE).setSemantics("https://schema.org/docs/jsonldcontext.jsonld#datePublished").setRequired(true), column("prepTime").setSemantics("https://schema.org/docs/jsonldcontext.jsonld#prepTime").setRequired(true)));
    recipeTable.insert(row("name", "Mary's Cookies", "author", "Mary Stone", "datePublished", "2018-03-10", "prepTime", "PT20M"));
}
Also used : Table(org.molgenis.emx2.Table)

Example 99 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table in project molgenis-emx2 by molgenis.

the class ProductComponentPartsExample method populate.

public static void populate(Schema schema) {
    Table partTable = schema.getTable(PART);
    Row part1 = new Row().setString(NAME, FORMS).setInt(WEIGHT, 100);
    Row part2 = new Row().setString(NAME, LOGIN).setInt(WEIGHT, 50);
    partTable.insert(part1);
    partTable.insert(part2);
    Table componentTable = schema.getTable(COMPONENT);
    Row component1 = new Row().setString(NAME, EXPLORER).setRefArray(PARTS, FORMS, LOGIN);
    Row component2 = new Row().setString(NAME, NAVIGATOR).setRefArray(PARTS, LOGIN);
    componentTable.insert(component1);
    componentTable.insert(component2);
    Table productTable = schema.getTable(PRODUCT);
    Row product1 = new Row().setString(NAME, "molgenis").setRefArray(COMPONENTS, EXPLORER, NAVIGATOR);
    productTable.insert(product1);
}
Also used : Table(org.molgenis.emx2.Table) Row(org.molgenis.emx2.Row)

Aggregations

Test (org.junit.Test)40 Table (com.google.privacy.dlp.v2.Table)23 Table (org.molgenis.emx2.Table)23 Table (com.google.bigtable.admin.v2.Table)21 ByteString (com.google.protobuf.ByteString)18 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column)17 ArrayList (java.util.ArrayList)14 AbstractMessage (com.google.protobuf.AbstractMessage)13 HashMap (java.util.HashMap)13 ColumnFamily (com.google.bigtable.admin.v2.ColumnFamily)11 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint)10 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint)10 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint)10 Row (org.molgenis.emx2.Row)10 IOException (java.io.IOException)9 List (java.util.List)9 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Enum (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Enum)7 DlpServiceClient (com.google.cloud.dlp.v2.DlpServiceClient)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Integer)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Table)6