public boolean isReturningGeneratedKeys() {
    if ( getDatabaseMeta() != null ) {
      return getDatabaseMeta().supportsAutoGeneratedKeys() && returningGeneratedKeys;
    }
    return false;
  }
@Test
  public void testIsReturningGeneratedKeys() throws Exception {
    TableOutputMeta tableOutputMeta = new TableOutputMeta(),
        tableOutputMetaSpy = spy( tableOutputMeta );

    DatabaseMeta databaseMeta = mock( DatabaseMeta.class );
    doReturn( true ).when( databaseMeta ).supportsAutoGeneratedKeys();
    doReturn( databaseMeta ).when( tableOutputMetaSpy ).getDatabaseMeta();

    tableOutputMetaSpy.setReturningGeneratedKeys( true );
    assertTrue( tableOutputMetaSpy.isReturningGeneratedKeys() );

    doReturn( false ).when( databaseMeta ).supportsAutoGeneratedKeys();
    assertFalse( tableOutputMetaSpy.isReturningGeneratedKeys() );

    tableOutputMetaSpy.setReturningGeneratedKeys( true );
    assertFalse( tableOutputMetaSpy.isReturningGeneratedKeys() );

    tableOutputMetaSpy.setReturningGeneratedKeys( false );
    assertFalse( tableOutputMetaSpy.isReturningGeneratedKeys() );
  }