0

I am using mysql, spring boot, spring data .... :D I am searching for solution to get all column names of a given table. But could not found as per my requirnments :(

Not want a solution with native query or mysql specific solution. Looking for general solution using spring data abstraction.

If there is any derived method query then it would be great.

thank you :)

Prashant Shilimkar
  • 8,402
  • 13
  • 54
  • 89
  • for what do you need the column names? For entity generation? – Patrick Dec 03 '15 at 09:49
  • not entity generation. for formula attributes. Is there any solution? – Prashant Shilimkar Dec 03 '15 at 10:00
  • No. You can probably do either using either the JPA Meta Model or by getting a handle on the underlying Connection and querying the DatabaseMetaData. For the former create a custom repo which will give you a refererence to the EntityManager and then get the connection from this (how will depend on your JPA provider). – Alan Hay Dec 03 '15 at 10:50
  • 1
    Possible duplicate of [Is there any Simplest way to get Table metadata (column name list) information, in Spring Data JPA ? which could I use on universal database](http://stackoverflow.com/questions/31239812/is-there-any-simplest-way-to-get-table-metadata-column-name-list-information) – manish Dec 08 '15 at 03:46

0 Answers0