Your mapping is completely wrong. Every entity class that has a composite primary key must have its own ID class, so if you have 2 tables, this will result in 4 classes, 2 entity classes and 2 ID classes.
whichever you choose does matter, because JPA implementations (Hibernate, EclipseLink, ...) have a different degree of bugginess with these.
I made a lot of tests and to me the JPA 1.0 @IdClass has the fewest problems. The Hibernate mapping system is very instable and throws many unexpected exceptions, so you might want to try EclipseLink or another JPA provider.
Don't expect ORMs to do what you think. Be prepared.
As for your code, please pick up a good source on how to map composite key classes. I don't have time to correct completely incorrect code.