Results 1 to 1 of 1
- 06-11-2011, 08:45 PM #1Member
- Join Date
- May 2011
- Rep Power
Setting Auto increment problem :(-:
I have a problem with my java apllication that i am unable to create a enitity persistence class..
The problem is that it does not takes the database table for entity class that doesn't have PRIMARY KEY..
I found a way for it by applying PRIMARY KEY as AUTOINCREMENT column..
But, since my application is to be work continuosly with database i cannot estimate a typical auto-increment value limit..
Now what i want is to apply a composit primary key with "date" , "id" column as primary keys together, the "id" must be a AUTO-INCREMENT value that can reset itself from the begening whenever a day changes , i.e, id values resets itself after each day ??
How can i achive this ??
What i tried is like something as follows::
create table test ( id int(4) zerofill auto_increment, mydate date, primary key (mydate,id) ); insert into test (mydate) values ('2011-06-01'), ('2011-06-02'), ('2011-06-02'), ('2011-06-01'), ('2011-06-01'), ('2011-06-03');
- By prats_7189 in forum AWT / SwingReplies: 1Last Post: 02-11-2010, 02:38 PM
- By oxxxis in forum Java 2DReplies: 0Last Post: 01-21-2010, 09:32 PM
- By Crisanto in forum New To JavaReplies: 3Last Post: 10-29-2008, 07:48 PM
- By dark_cybernetics in forum EclipseReplies: 0Last Post: 08-19-2008, 11:19 AM
- By Albert in forum JDBCReplies: 2Last Post: 07-04-2007, 05:23 AM