K
K
KirylLapouski2017-11-28 01:38:47
Java
KirylLapouski, 2017-11-28 01:38:47

How to get column names from sql query in Hibernate?

How to get query column names from SQLQuery object?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-11-28
@KirylLapouski

From object SQLQuery in any way. But you can get meta-data for any entity from SessionFactory:

String[] columnNames = getSessionFactory()
                        .getClassMetadata(SomeEntity.class)
                        .getPropertyNames();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question