Hey all,

2010/8/17 Alan Alvarez <[email protected]>:
>
> On Tue, Aug 17, 2010 at 3:21 PM, Sohail Somani <[email protected]>
> wrote:
>>
>> On 10-08-17 1:40 PM, Alan Alvarez wrote:
>> > Hello,
>> >
>> >      I'm new to using Wt and Dbo. I was wondering what the best way
>> > would be to apply constraints (such as PRIMARY KEY and UNIQUE). Also if
>> > there is support for SERIAL type in the PostgreSQL backend.
>>
>> I did this by writing the schema myself and not using createTables. It's
>> simpler and more deterministic. Don't know about the SERIAL type.
>>
> I thought about doing this myself, however, this "surrogate" id field is
> given the PRIMARY KEY constraint, so I can't do the same with my id fields.
> Is it at least possible to use this field in a straight-forward way using
> class-mapping

Since Wt 3.1.4, you have full control over the mapping. See
http://www.webtoolkit.eu/wt/doc/tutorial/dbo/tutorial.html#customizing

Before 3.1.4, it was indeed the case that the use of 'id' and
'version' fields was baked-in.

>> > I was also wondering you you guys chose to add the extra fields id and
>> > version to all tables. Why not chose a less commonly-used name for these
>> > fields.

You can now easily modify the name by specializing dbo_traits. If you
like to do this for all of your classes, you can easily create a macro
to specialize dbo_traits for each of your mapped classes.

Regards,
koen

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to