Open Ebaneck opened 6 years ago
Solution to the above with help from a mate(Binoy)
Add add an model (id) of type int. hence the new clause for updating a single identity will be
PreparedStatement statement = connection.prepareStatement("update IDENTITIES set DISPLAY_NAME=?, EMAIL=?, UID=?" + "where IDENTITY_ID=?"); statement.setString(1, identity.getDisplayName()); statement.setString(2, identity.getEmail()); statement.setString(3, identity.getUid()); statement.setInt(4, identity.getId());
statement.executeUpdate();
my update was working great.why did u ask binoy?
this was an entire new issue which concerned the definition of the database schema. he also just noticed that the database definition has field for Identity id which is separate from the UID.
PreparedStatement statement = connection.prepareStatement("update IDENTITIES set DISPLAY_NAME=?, EMAIL=?, UID=?" + "where IDENTITY_ID=?");
The above seems to be the supposed way to make sql queries for updating an identity.
I had that query
Noticed the database schema definition had identity_id as the primary key which is the unique feature... this implies that the UID column should be update-able hence both the select, update and delete prepared statements should affect the UID column. Since the only unique column is IDENTITY_ID