I would like to achive a simple dropdown (a @ManyToOne and
@DescriptionsList) using an Entity not really stored on DB.
I have a table like this:
codice char(9) PK
I have a normal Entity Comune and I would like to have a virtual Entity
Provincia from a query like: SELECT DISTINCT provincia AS sigla FROM Comune
This way I could use a @ManyToOne annotation with @DescriptionsList.
I would definitively add one more table called Provincia. I would then make the provincia of Comune a Foreign key in your database schema.
Then you naturally would have a @ManyToOne
I would follow the Laurent advice. However, if you have not the option of creating a new table, you can create a SQL VIEW and map it with a Provincia entity.
Help others in this forum as I help you.
Need more help? Get OpenXava professional support.
Log in to post a comment.