Hey Carlo,
In short - yes you can :).
Before answering to your query I would like to correct you - GeDA only works with public getters/setters (i.e. no direct field access). This is by design to promote encapsulation (no nasty peaking inside the objects behind the scenes)!
Option 1: fake getter (recommended)
So in order to have a nonGetterMethod you need:
1. Mark it as readOnly = true - that will tell GeDA not to look for setter see
annotation or
DSL docs
2. have a "public String getNonGetterMethod()" on your entity, so it follows the getX naming convention. But it can "get" whatever you like, so any custom logic can go in there.
Option 2: virtual field
GeDA can map virtual fields (i.e. derived or computed), which in essence really your nonGetterMethod itself. To use virtual field you need:
1. Use virtual field mapping api, see
annotations or
DSL docs for this
2. Have a custom implementation of
ValueConverter. As this is virtual field this converter will have the whole entity as its parameter, so you can just invoke the nonGetterMethod, or better yet the implementation of your value converter.convertToDto() would be your implementation of nonGetterMethod. This way you can separate nasty logic from your domain object.
Let me know if you have further questions.