package cbe.inserting.model; import org.apache.commons.codec.digest.DigestUtils; import cbe.inserting.model.auto._Person; public class Person extends _Person { /** * Override the default setPassword() method generated by Cayenne to * automatically hash the plain-text password before storing it in the * database. * * @see cbe.inserting.model.auto._User#setPassword(java.lang.String) */ @Override public void setPassword(String unencryptedPassword) { // A real password handler would do more than this. Read: // http://www.owasp.org/index.php/Hashing_Java super.setPassword(DigestUtils.shaHex(unencryptedPassword)); } }