/** * PUBLIC: * Return the qualifier for the all of the tables referenced by TopLink. * This can be the creator of the table or database name the table exists on. * This is required by some databases such as Oracle and DB2. * This should only be used if all of the tables have the same qualifier. * It can also be set on each descriptor when the table name is specified. */ public String getTableQualifier() { return getDatasourcePlatform().getTableQualifier(); }
/** * INTERNAL: * Check that the qualifier on the table names are properly set. */ protected void verifyTableQualifiers(Platform platform) { DatabaseTable table; Enumeration tableEnumeration; String tableQualifier = platform.getTableQualifier(); if (tableQualifier.length() == 0) { return; } tableEnumeration = getTables().elements(); while (tableEnumeration.hasMoreElements()) { table = (DatabaseTable)tableEnumeration.nextElement(); if (table.getTableQualifier().length() == 0) { table.setTableQualifier(tableQualifier); } } }
/** * INTERNAL: */ public void onConnect() { super.onConnect(); qualifier = getDatasourcePlatform().getTableQualifier(); }
protected void initializeReferenceTable(AbstractSession session) throws DescriptorException { Platform platform = session.getDatasourcePlatform(); if (getReferenceTable() == null) { throw DescriptorException.referenceTableNotSpecified(this); } if (platform.getTableQualifier().length() == 0) { return; } if (getReferenceTable().getTableQualifier().length() == 0) { getReferenceTable().setTableQualifier(platform.getTableQualifier()); } }
/** * INTERNAL: * Set the table qualifier on the relation table if required */ protected void initializeRelationTable(AbstractSession session) throws DescriptorException { Platform platform = session.getDatasourcePlatform(); if ((getRelationTable() == null) || (getRelationTableName().length() == 0)) { throw DescriptorException.noRelationTable(this); } if (platform.getTableQualifier().length() == 0) { return; } if (getRelationTable().getTableQualifier().length() == 0) { getRelationTable().setTableQualifier(platform.getTableQualifier()); } }