While trying to update rows using a DataSet the following exception appears :
java.sql.SQLRuntimeException: DataSet cannot be modified.
Using build 80 of mustang and today's official Trondheim build of the Derby trunk.
Code :
Here's the method that's doing the updating:
/**
* Updates a list of addresses using DataSet
*/
public void updateAddresses()
throws SQLException {
AddressQueryIdSubset aq =
con.createQueryObject(AddressQueryIdSubset.class);
DataSet<Address> addresses = aq.getAddresses();
if (addresses.isReadOnly())
throw new SQLException("DataSet is readOnly!");
for (Address val : addresses) {
val.setCity("Davis");
addresses.modify(); // [Exception thrown here]
}
aq.close();
}
And here's the query interface:
public interface AddressQueryIdSubset extends BaseQuery {
@Select(readOnly=false,
sql="SELECT addrid, street, city, state, zipcode, country"
+ " FROM addresses WHERE datastore_identity < 5")
DataSet<Address> getAddresses();
}
java.sql.SQLRuntimeException: DataSet cannot be modified.
Using build 80 of mustang and today's official Trondheim build of the Derby trunk.
Code :
Here's the method that's doing the updating:
/**
* Updates a list of addresses using DataSet
*/
public void updateAddresses()
throws SQLException {
AddressQueryIdSubset aq =
con.createQueryObject(AddressQueryIdSubset.class);
DataSet<Address> addresses = aq.getAddresses();
if (addresses.isReadOnly())
throw new SQLException("DataSet is readOnly!");
for (Address val : addresses) {
val.setCity("Davis");
addresses.modify(); // [Exception thrown here]
}
aq.close();
}
And here's the query interface:
public interface AddressQueryIdSubset extends BaseQuery {
@Select(readOnly=false,
sql="SELECT addrid, street, city, state, zipcode, country"
+ " FROM addresses WHERE datastore_identity < 5")
DataSet<Address> getAddresses();
}