incubator-empire-db-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From T-Rex <trex...@googlemail.com>
Subject column ambigously defined / table alias
Date Tue, 17 Aug 2010 12:37:47 GMT
Hello empire-db community,

in our application we've got a similar problem like the given example below.
We build a command object with different joins depending on different
expressions.

As you can see we have an inner join and a left outer join on the same
tables.
If we execute the statement we get the exception: column ambiguously
defined.
>From our point of view the framework is not able to set the table aliases on
it's own if required and
we do not have the possibility to set the alias manually.

Furthermore we see not the possibility to create a full outer join.

Example:
###################################################

public class PROJECTDB extends DBDatabase
{
    public TTableA           T_TABLEA;
    public TTableB           T_TABLEB;

    public static class TTableA extends DBTable
    {
        // Spaltendefinitionen
        public final DBTableColumn  C_ID_A;
        public final DBTableColumn  C_VALUE_A;
        public final DBTableColumn  C_ID_C;
    ...
    }
    public static class TTableB extends DBTable
    {
        // Spaltendefinitionen
        public final DBTableColumn  C_ID_A;
        public final DBTableColumn  C_VALUE_B;
    ...
    }


...

}

public class DO_SOME_THING
{

...

    public method_B (DBCommand cmd)
    {
        cmd.join  (PROJECTDB.TTableA.C_ID_A, PROJECTDB.TTableB.C_ID_A,
DBJoinType.INNER);
    }

    public method_C (DBCommand cmd)
    {
        cmd.join  (PROJECTDB.TTableA.C_ID_A, PROJECTDB.TTableB.C_ID_A,
DBJoinType.LEFT);
    }

..

    public method_A
    {
        DBCommand  cmd = ...;

        if (expressionX()) {
        method_C(cmd);
        }

        if (expressionY()) {
        method_B(cmd);
        }
...
        readValuesFromDB(cmd);
...

    }
###################################################

Do you have any clues?

Regards,

Pascal

Mime
View raw message