Not specifying a property-ref creates a foreign key, coz by default the primary key of the referenced table is used - User.id. If you provide a property reference, like "User.username" in your case, you are referencing another column (note this is not the relationship you want in the first place, right??) And User.username is not a key anyways, so you wont have a foreign constraint either. Best that hibernate can do is, ignore it rather than fail with an exception by not even creating a basic table schema.
If you want a relationship on username, you could consider adding that as the id?? or add an index over it with the index attribute or a unique constraint..cant say if that would work, never tried it.
--
|