aspose file tools*
The moose likes JForum and the fly likes Unique ids? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Unique ids?" Watch "Unique ids?" New topic
Author

Unique ids?

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
In general, yes this is true. Especially for the items you talked about. If you dig into the database definitions you will find them listed as primary keys and generally set up as "autoincrement" fields. Both of which need to be unique.

However, be aware that in the < 3.0 series there are several jForum tables that don't have a single field defined as a primary key. Generally these are "relational" tables like group membership and the like. I doubt you'll have to deal with them for your project, but just in case...

[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I want to store extra information about topics and entries in my own database. Can I assume that it is impossible to have two topics with the same id, even in different forums? And also impossible with to entries with the same id.

My experience so far is that all ids are unique across any type of object. Hence if a topic has id 1, than no user, forum or entry may have that id. Is this also correct?

Best Regards
[originally posted on jforum.net by frankern]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Good to know anyway - thanks!
[originally posted on jforum.net by frankern]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unique ids?
 
Similar Threads
String comparisons vs switch case
on accessing elements with same IDs from several rows with different IDs
currentTimeMillis as UniqueIDGenerator
Input in a Nested table
JQuery Selector Question Regarding Element Reuse