incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Connectors Framework > How to Write an Output Connector
Date Tue, 19 Oct 2010 07:40:00 GMT
Space: Apache Connectors Framework (
Page: How to Write an Output Connector (

Comment added by Karl Wright:

The ManifoldCF database abstraction is, of course, a limited one.  You can't do everything
that you can do in every kind of database there is out there.  However, you \*can\*
effectively define the equivalent of a multiple primary key relationship simply by doing the

(1) create your columns, labeling NONE of them as "primary key".

(2) create a unique index on the columns you want to be your multiple primary key.\\

In PostgreSQL this does the same thing as a multiple primary key.\\

In reply to a comment by Farzad:
I was looking at the code for DBInterfacePostgreSQL in org.apache.manifoldcf.core.database
and looks like it is not setup to handle multiple primary keys.  Aren't primary keys suppose
to be listed together as a comma separated list?

  protected static void appendDescription(StringBuffer queryBuffer, String columnName, ColumnDescription
cd, boolean forceNull)
    queryBuffer.append(' ');
    if (forceNull || cd.getIsNull())
      queryBuffer.append(" NULL");
      queryBuffer.append(" NOT NULL");
    if (cd.getIsPrimaryKey())
      queryBuffer.append(" PRIMARY KEY");
    if (cd.getReferenceTable() != null)
      queryBuffer.append(" REFERENCES ");
      queryBuffer.append(") ON DELETE");
      if (cd.getReferenceCascade())
        queryBuffer.append(" CASCADE");
        queryBuffer.append(" RESTRICT");

Change your notification preferences:

View raw message