You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2017/11/19 20:36:00 UTC

[jira] [Created] (METAMODEL-1170) Add a Schema.getTablesOfType(TableType) convenience method

Kasper Sørensen created METAMODEL-1170:
------------------------------------------

             Summary: Add a Schema.getTablesOfType(TableType) convenience method
                 Key: METAMODEL-1170
                 URL: https://issues.apache.org/jira/browse/METAMODEL-1170
             Project: Apache MetaModel
          Issue Type: Improvement
    Affects Versions: 5.0.0
            Reporter: Kasper Sørensen
            Priority: Minor


I suggest adding a convenience method called something like "getTablesOfType(TableType)" on the Schema interface. This request is coming after the 5.0.0 introduction of alias tables which is generally good, but I have noticed that I write these lines again and again whenever I don't want to have the alias tables:

{code}
schema.getTables().stream().filter(t -> t.getType() == TableType.TABLE).collect(Collectors.toList());
{code}

I don't particularly like that line of code. So a convenience way of getting the same by just calling:

{code}
schema.getTablesOfType(TableType.TABLE);
{code}

would be a big syntax improvement. It could even be implemented as a default method with the above implementation on the Schema method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)