These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Shared, auto generated id
PostPosted: Fri Oct 26, 2007 6:37 am 
Beginner
Beginner

Joined: Fri Apr 27, 2007 11:50 am
Posts: 23
Hi guys,

I need to map the following senario and could do with some help.

I have a Content entity, that has a unique id to identify itself, however each Content entity has a shared id property. The perpose of this property is to group the content items together.

What i want to do though is have that shared id as an autoinrementing number (ie for an item that is created with no shared id a new id is created one increment higher than the maximum shared id value in the database) but is unique per group, not per row like the primary key.

Hopefull i've explained this well enough.

Could anybody offer any advice on how to go about this?

Many thanks

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 9:15 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
How do you identify group for content entities?

_________________
Please rate this post if you find it helpful


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 12:18 pm 
Beginner
Beginner

Joined: Fri Apr 27, 2007 11:50 am
Posts: 23
It's just a integer, ie

Id.....Group
1.......1
2.......1
3.......1
4.......2
5.......2
6.......2
7.......2
8.......3

etc


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 29, 2007 7:01 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
I mean how do you decide that 1,2,3 have group id 1 and 4,5,6,7 belongs to group 2.

_________________
Please rate this post if you find it helpful


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 29, 2007 8:28 am 
Beginner
Beginner

Joined: Fri Apr 27, 2007 11:50 am
Posts: 23
Ahh, if an item belongs to a group this will be set manually by seleting on the front end what group it belongs to. If when saved it does not belong to a group, it should create and belong to the next group number.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.