How to map a column that does not exist in the database?

3

I'm having a small problem mapping (JPA) columns to a class in my system. I have some procedures in the bank that do a lot already and I would not like to stop using them, but I do not know how to map.

SELECT r.*, ultimo_documento(r.id) as ultimo, ultima_acao(r.id) as ultima,
abcd(r.id, r.nome) as campo_teste
FROM requerimento

I have in my class the fields ' ultimo , ultima , campo_teste ' mapped with @Transient. But these fields are not filled. I use @NativeQueries declared before the entity.

How to map a column that does not exist in the database?

    
asked by anonymous 06.10.2016 / 05:00

1 answer

0
query.addScalar("campo_teste", StringType.INSTANCE); // Ou seja lá qual for o tipo
query.list();

?

    
26.10.2016 / 20:02