I have a table in my MYSQL database which does not have a primary key, but has a unique key on two columns. When using MyEclipse's Hibernate reverse engineer tool to create a mapping for that table, it generates two classes, one for named after the table itself, and one with an "Id" suffix. It seems most of the useful methods ended up in the Id class, so it seems that is the one you would instantiate and save to persist data. I can appreciate the fact that the Id class is created in order to represent a unique row in the table / mapped object, but what is the use of splitting out this into two classes, and what, then is the use of the non-Id-suffixed class?
My colleague argues you can accomplish the same with just one class and scoffs at using the reverse engineering for these tables which don't have a primary key. I, on the other hand, assume MyEclipse developers are much smarter than me and that there is a really good reason to do it this way. Is there?