Is there a way to index my POJOs without running another SQL statement
similar to the way it is done in Hibernate?
eg
All my POJOs have an object that acts as the key for the object, called id
currently I generate this in Ibatis by defining another SQL statement
to retrieve the id field
<resultMap id="getCustomerResult" class="customer">
<result property="id" column="{account=ACCOUNT,branch=BRANCH}"
select="getCustomerId"/>
<result property="email" column="email"/>
</resultMap>
but this also means that for every record I retrieve from the relevant
file i must run another SQL statement to generate the id.
Is there any way in Ibatis to do this without running another SQL Statement
eg in Hibernate
<composite-id name="id" class="CustomerKey">
<key-property name="account" type="long" column="ACCOUNT"/>
<key-property name="branch" type="long" column="BRANCH"/>
</composite-id>
will take the values from the fields ACCOUNT and BRANCH and use them
to construct a CustomerKey object