File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes [Solved]Hibernate and unknown databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Solved]Hibernate and unknown databases" Watch "[Solved]Hibernate and unknown databases" New topic

[Solved]Hibernate and unknown databases

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 75
Hello again my fellow ranchers, I'm back again with another question...

It's possible to hibernate to get info from a table without doing a mapping cause that table's structure is unknown to the developer? (without going back to use native SQL)


without going back to use native SQL=old fashioned JDBC.

That's what I wanted to say.

Thanks for your quick reply.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

No, the mapping needs to exist.You can use Hibernate tools to generate mappings files or aonnotated classes from a database but this isn't really something you could do at runtime.

You don't however need to use Hibernate or native SQL to get information about a table. you can get that from godd old fashioned JDBC.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: [Solved]Hibernate and unknown databases
It's not a secret anymore!