[TYPO3-ect] About ORM
ries van Twisk
typo3 at rvt.dds.nl
Thu Oct 25 14:55:46 CEST 2007
> On 10/24/07, ries van Twisk <typo3 at rvt.dds.nl> wrote:
>>
>>
>> On Oct 24, 2007, at 11:13 AM, Philip Almeida wrote:
>>
>>> Hello list,
>>> for those of you that don't know this site please go there now. :)
>>>
>>> http://www.phpobjectgenerator.com
>>>
>>> regards,
>>>
>>> philip
>>
>>
>> I think it's nice for the CRUD type of applications...
>> However to bad that they by default add an auto increement
>> which is sometimes not very use full (forces bad DB design I think).
>>
>> Ries
>
>
>
> Hi Ries,
> What do you recommend, Mysql does not have sequence, what should be
> used to
> create the id's?
>
> regards,
>
> philip
If you have for example a system where you want to store unique users,
then the mail address or the username of would be the candidate for a
primary
key, not a serial number.
By doing this you can enforce uniqueness of users on de database
level and
get rid of that surrogate key at all.
I know you can add a unique index not null constraint on such a mail/
username field.
But then you still have that auto increment in your database which is
useless.
I think any of these object generators (to be honest I didn't check
many of them...) should allow
you to pick any field or group of fields as the primary key. Not
assuming you want
a autonumbering.
Ries
More information about the TYPO3-team-extension-coordination
mailing list