Hello,

*Use case:* I was using Apache Meta Model 5.2.0 in my project.There is
MySQL source with Table Customer. Customer table has column Id which is
primary key and marked auto increment.
The use case is to get the generated *Id *in return when we insert the
record so that user can again query using same returned *Id *to get the
record back if required.

The returning of generated keys has been fixed sometime back by introducing
Update Summary, but update summary does not tell us what is the column name
of that generated value being returned.i.e it just return the value being
generated.

Possible solution could be if  somehow we know before hand from column
metadata what column is marked auto increment/ auto generated.This way we
can expect the same in return.

*Problem: *Current meta model implementation doesn't capture this auto
increment property like others i.e name,data types etc; even though the
underlying driver is returning the information.

*Technical's:*  While debugging through the code for MySQL source ,observed
that in loadColumns method in JdbcMetadataLoader class we obtain the
ResultSet from the driver implementation class.This ResultSet has the
required information at index 23 i.e rs.getString(23) but we only capture
certain important information like name, datatype etc and create JdbcColumn
from those.
The solution can be, introducing another variable to capture this property
as well just like others.
Tried the same with PostgreSQL and behavior is similar. The value can be
null if this information is supported by any source.

It would be great if you could share your thoughts on this.Are there any
plans for such changes in future.

Thanks & Regards
Ratish Bansal

Reply via email to