DBSetup : SQL support

201 Views Asked by At

I am trying to use DBSetup for my testing. I was able to make it run with simple Inserts:

public static final Operation INSERT_CURRENCY_DATA = 
    Insert.into("CURRENCY")
        .columns("ID", "CODE", "NAME", "DESCRIPTION")
        .values(1, "EUR", "EUR", "EUR")
        .values(2, "CZK", "CZK", "CZK")
        .build();

But when one table has a foreign key in another table like the example below from the website:

Operation insertVendorsAndProducts = 
    sequenceOf(
        insertInto("VENDOR")
            .columns("ID", "CODE", "NAME")
            .values(1L, "AMA", "AMAZON")
            .build(),
        insertInto("PRODUCT")
            .columns("ID", "NAME", "VENDOR_ID")
            .values(1L, "Kindle", "1L")
            .build(),
        sql("update VENDOR set FEATURED_PRODUCT_ID = 1 where ID = 1"));

I could not compile the code and getting Syntax error on token ',',.expected in the .build(), line

0

There are 0 best solutions below