Research Log of Web Science Students

Computer Science is not simply programming

Google Database

leave a comment »

Problem: I’ve been wondering why only one project can be uploaded by any user. We use Google so it should scale right?

Solution: Set the ID as PRIMARY KEY, not any other entity! This ID column by Google automatically increments every time a project is “uploaded”. Coooool.

</p>
<p>&lt;span style=&quot;background-color: #ffffff; &quot;&gt; @PrimaryKey&lt;/span&gt;</p>
<p>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)</p>
<p>private Long id;</p>
<p>

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
Advertisements

Written by Daniela

October 11, 2009 at 9:47 am

Posted in ProjectriX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: