fetching partial entity data with hibernate
we have a spring/hibernate -> swing application
the communication is soap with axis, the hibernate entities are mapped to soap objects and travel from the server to the client and back.
we have some entities that we don't want to select all the fields every time, in some cases we need only partial data of the entity.
for example a Profile entity with id,name ,description and many other primitive and non primitive fields,
the UI people do not want to deal with a Profile object when they need only part of the data, they want for example a ProfileIdentifier object that has the profile id,name and description.
so we can do it with inheritance
class Profile extends ProfileIdentifier
or with a ProfileIdentifier component or value type,
i want to be able to fetch a list of ProfileIdentifier objects and not the Profile objects.
what is the prefered way to do it?
is there a way to select only ProfileIdentifier with inheritance or as a component?
or to select a partial Profile, only the fields in ProfileIdentifier and convert the result to ProfileIdentifier?