I have a file company.txt with 2 columns:
1 Angola
2 Apple
3 Argentina
4 Facebook
5 Google
6 Twitter
7 Samsung
8 LinkedIn
9 Yahoo
At MySql command line, I executed:
LOAD DATA LOCAL INFILE `'company.txt' INTO TABLE Term FIELDS TERMINATED BY`;
select * from Term;
+----+-----------+
| id | name |
+----+-----------+
| 1 | Angola |
| 2 | Apple |
| 3 | Argentina |
| 4 | Facebook |
| 5 | Google |
| 6 | Twitter |
| 7 | Samsung |
| 8 | LinkedIn |
| 9 | Yahoo |
+----+-----------+
9 rows in set (0.00 sec)
This all look fine. However, when the database tables are created through Hibernate in code this file is loaded through JBoss configuration file, the record order of the loaded file into the table is slightly different:
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
The new order:
select * from Term;
+----+-----------+
| id | name |
+----+-----------+
| 1 | Angola |
| 2 | Apple |
| 3 | Argentina |
| 4 | Facebook |
| 5 | Google |
| 8 | LinkedIn |
| 7 | Samsung |
| 6 | Twitter |
| 9 | Yahoo |
+----+-----------+
As you can see, the order is
1 2 3 4 5 8 7 6 9
Not
1 2 3 4 5 6 7 8 9
But the id -> name mapping is still right, although the record order is slightly different. Does this matter (ID not in sequential order)?