I am using Apache DdlUtils to query a PostgreSQL database for table and column meta-data (the end-aim being to automatically generate javax.persistence-annotated entity beans). However it seems to me that the DdlUtils library does not provide a way to obtain the names of sequences used in auto-increment columns. The Column class provides an isAutoIncrement method to query for auto-increment status but I couldn't find a way to get the sequence name associated with it. This is part of the DDL in PostgreSQL, eg:
orders=# \dS customer
Table "public.customer"
Column | Type | Modifiers
---------------+-------------------+--------------------------------------------------
id | integer | not null default nextval('cst_id_seq'::regclass)
name | character varying | not null
(...)
Should I directly query some metadata / catalogue table instead to obtain that bit of information?