DbAttributes are limited to the set of types defined in JDBC spec. So Cayenne capabilities for generating DB schemas from Cayenne are necessarily limited as well unfortunately. We may consider adding DB-specific type hints to the model in the future... Something to think about.
Instead in 4.0 we started to focus heavily on DB-first flow and automating DB reverse-engineering. In M3 (and especially in M4 ) "cdbimport" is the king, and a workflow usually looks like this:
* You'd use a SQL migrations framework to bring a local DB to a certain version. This is outside of the scope of Cayenne and is done with a third-party tool such as Liquibase or Flyway.
* OR mapping model (Cayenne XML files) is synchronized with the state of the database using "cdbimport" provided by Cayenne.
* Object layer of the OR mapping model is customized to the developer liking, usually via CayenneModeler. Subsequent runs of "cdbimport" will not override any customizations that you make.
* Java classes are generated using "cgen" provided by Cayenne.
> On Oct 25, 2016, at 4:05 PM, fael <[hidden email]> wrote:
> Hello all,
> I was using Cayenne's baked in AUTO_PK_SUPPORT up till very recently.
> Have now switched to use database-generated keys - I'm using the MySQL
> My keys are all defined in MySQL as BIGINT(20) UNSIGNED NOT NULL
> Foreign key fields are defined as BIGINT(20) UNSIGNED (sometimes NOT NULL).
> I was really pleased to see that for new DbEntity items when I correctly set
> the PK Generation Strategy an 'AUTO_INCREMENT' is added to the generated SQL
> when migrating!!
> I did hit a wall when trying to set a DbEntity attribute type to be
> specifically an UNSIGNED BIGINT; can't seem to do this and therefore can't
> use the modeller to migrate for my UNSIGNED BIGINT.
> Even if this may not be something worth adding in - I wondered whether there
> was any way I might override or configure to achieve this.
> Many thanks,