Hi once again,
what i would like to do is, that i have a Entity “order”, that has a attribute of type Date “orderDate”. In the @NamePattern Annotation i would like to render the attribute “orderDate”. Thats what i did:
@NamePattern("%s|orderDate")
@Table(name = "TEST_ORDER")
@Entity(name = "test$Order")
public class Order extends StandardEntity
that it creates the default toString representation of it (“Wed Jun 17 00:00:00 CEST 2015”). What i would like to achieve is, that it takes the configured “dateFormat” into account, that it prints like this: “17.06.2015”
I tried to, instead of using “%s”, use a method like this: “@NamePattern(”#getFormattedOrderDate|orderDate"). To not reinvent the wheel, i looked at “com.haulmont.cuba.gui.components.formatters.DateFormatter” to get the implementation. The problem with this is, that this class is in the “GUI” module, whereas the Entity is in the global module. Since there is no dependency in this direction, there seems to be no way to use this class to get the thing done.
What i would like to know is, if there is a standard way of doing it (perhaps even without using a custom method at all), and if not, how would deal with this cyclomatic dependecy thing.
thx,
Mario