As far as i know, there is no spec compliant way of doing this. Each persistence provider (Hibernate, TopLink etc...) have their custom ways for reverse engineering. See this Hibernate documentation https://www.hibernate.org/255.html
as far as I know, Eclipse + WebToolsPlatform-plugin + Data Tools Platform plugin provide a way to generate entities from a schema. But I never used this, so I cannot help you much further.
Thanks jaikiran and Wolfgang. Let me try these out. Will sure let you know what worked.
Thanks guys, just to answer to that. I used Hibernate tools. It works pretty pretty well and is easy to use. https://www.hibernate.org/hib_docs/tools/reference/en/html/plugins.html gives you more info.