Yes, you can. See section 2.2.2.2 of the Hibernate annotations documentation:
By default the access type of a class
hierarchy is defined by the position
of the @Id
or @EmbeddedId
annotations. If these annotations are
on a field, then only fields are
considered for persistence and the
state is accessed via the field. If
there annotations are on a getter,
then only the getters are considered
for persistence and the state is
accessed via the getter/setter. That
works well in practice and is the
recommended approach.
So if you put your @Id
on a field, then Hibernate will look at annotations on the fields for the other properties. If you put @Id
on a getter, then Hibernate will look at annotations on the other getters.