Thought inc.

The Dynamic O/R Mapping Company
     

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Questions
Key generators
< Previous Thread     Next Thread >
Author
Thread    Post New Thread     Post A Reply
dkalfus
Member

Registered: Oct 2005
Posts: 1

I'm converting an existing project from Castor to Cocobase. The project currently makes use of Castor's key-generator when inserting new db objects. What is the simplest way to reproduce this in Cocobase? Do I need to supply my own key-generator? TIA.

10-05-2005 01:33 PM
Click Here to See the Profile for dkalfus    Find more posts by dkalfus        Edit/Delete Message    Reply w/Quote    IP: Logged
admin
Administrator

Registered: Apr 2001
Posts: 19

Because CocoBase Enterprise is typically used with large scale databases (such as Oracle, DB2, Sybase) which all have built in sequence support that can be leveraged, the 'focus' of the identity management is based on allowing you to specify mapping that uses those features.

CocoAdmin mapping supports database sequences, stored procedures which generate sequences, or even using 'table' based sequences. You can even produce a 'plugin' to CocoAdmin that will automatically 'adjust' your maps when you create new ones and modify your mapping meta data based on your own naming conventions or hooks to specify which columns are identity columns. You can also 'manually' adjust maps to specify which ones are identity/sequence columns on a per class basis using CocoAdmin.

Which database do you wish to use CocoBase against, and which sequence type do you wish to use (database, procedure or table)?

Note, that the runtime plugin architecture also supports plugging in any custom sequence generator you wish to use...

Our best guess is that you'll probably create a sequence table and use the CS_TABLE syntax to support this. If you need a sample map and sample table construct to demonstrate this, just email support@thoughtinc.com and we can email you a prototype you can import. If you let us know which database type you'll be using, they can send you better instructions for what the easiest options for your specific environment are.

Chapter 9 of the programmers guide also walks through the use of Sequence/Identity map settings. And don't forget that the CBFacade needs a cocosource.autoidentity=true property definition in your CBFacade connection properties. This tells CocoBase that you are using maps that contain sequence/identity columns, and that the process of inserting will automatically modify your business objects.

Hope that helps!

THOUGHT Support

10-05-2005 02:04 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.