I have a table that uses a primary key with automatic addition and has several fields.
<column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" />
<column name="field1" type="INTEGER" required="true" />
<column name="field2" type="INTEGER" required="true" />
<column name="field3" type="INTEGER" />
<column name="field4" type="INTEGER" />
<column name="field5" type="INTEGER" />
I want to make sure that the field1+ combination is field2not used more than once, so I added them as primary keys in addition to the identifier, but this creates problems when I try to use findPK(). I would prefer that auto-incremented id be added as the primary key, but I also want to make sure that combo field1+ is field2not entered more than once.
<column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" />
<column name="field1" type="INTEGER" required="true" primaryKey="true" />
<column name="field2" type="INTEGER" required="true" primaryKey="true" />
source
share