Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Custom PK Generation

$
0
0
I have a use case where a primary key (id) of my table need to come from a concatenation of #year#month#id. It is a combination of date & sequence (e.g. 201403-0001, 201403-0002).

I spend a whole day trying to solve this problem (reading Smart GWT Quick Start, searching forum, reading online doc), but did not find a solution for this use case.

I've tried Velocity (Server-assigned values) and SQL Templating (by the way, I could not find any working example of "customInsertExpression").

I also tried to solve it through database (MySQL), found a solution, but it works only on MyISAM table, not InnoDB.

I found some threads in the forum suggest the use of "synthetic primary key", but could not find any example for that.

So, what is the right approach to tackling this rather common problem?

Viewing all articles
Browse latest Browse all 4756

Trending Articles