Skip to content

Instantly share code, notes, and snippets.

@stalep
Created October 22, 2013 13:01
Show Gist options
  • Save stalep/7100327 to your computer and use it in GitHub Desktop.
Save stalep/7100327 to your computer and use it in GitHub Desktop.
reduce the number of reflection calls from EntityTuplizer in hibernate
public interface HibernateValueMapper {
void $hibernate_setValue(Object value, String fieldName);
}
bytecode impl in entities:
...
public void $hibernate_setValue(Object value, String fieldName) {
if(fieldName == "name")
name = (String) value;
else if(fieldName == "address";
address = (Address) value;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment