I am giving the values to composite keys which are in database
When Hibernate encounters a composite key it can use a number of things to uniquely identify the object. If you have not defined a composite identifier class for your currency object, then Hibernate is using the currency object itself to uniquely identify currency objects. i.e. the class is its own PK. So when Hibernate goes to persist an object it will compare the currency class with existing records. If you have not overridden the equals method then it does this as described in the JDK JavaDocs for Object.equals(Object o). If it doesn't find one which matches, then its an INSERT you are performing in the DB not an UPDATE.
If you are letting a Currency object be its own PK, then for an update to happen,
all values of the currency object must be the same as an existing one. So changing the currency text value means you will be identifying a different record. So its pointless to do this unless you override the equals method for Currency (and the hashCode method).
Of course, this can only happen if your composite key is not actually defined in the DB, otherwise the DB should complain that you are trying to insert a record with an existsing PK. Check the DDL for the currency table. If the PK constraint is properly defined and this is still happening, then we have a wierd problem.
Shud we get the persistant object to be updated before assigning the new values? Is it compulsory?
Its not compulsory, but I can't think of a reason why you would not do it. Think about how database applications usually work - can you think of an occassion when you would try to update something without knowing if it were in the DB in the first place?