0

I have a 25 .xsd schemas and want to generate DB tables and POJO classes from this schemas.
Hibernate can do it? Im already try generate DB tables with XMLSpy and POJO with JiBX, but when i generate mapping with Hibernate names of tables in DB and in mappings was different. I want to use single tool to do this.

UPDATE

I try generate POJO with hibernate. I create \hibernate.cfg.xml ,hibernate.reveng.xml and console config. And when i try run configuration get error

org.hibernate.MappingException: Could not configure overrides from file: D:\liferay-develop\workspace\JABX_test\src\hibernate.reveng.xml
Could not configure overrides from file: D:\liferay-develop\workspace\JABX_test\src\hibernate.reveng.xml
org.hibernate.MappingException: invalid override definition
invalid override definition
org.hibernate.MappingException: invalid override definition
invalid override definition
org.xml.sax.SAXParseException: The content of element type "hibernate-reverse-engineering" must match "(schema-selection*,type-mapping?,table-filter*,table*)".
The content of element type "hibernate-reverse-engineering" must match "(schema-selection*,type-mapping?,table-filter*,table*)".

When i use empty TableFilter in reverse enginering hibernate create POJO but only from deafult postgres tables.

what i doing wrong?

UPDATE 2

How i use this tutorial http://www.youtube.com/watch?v=tfZiKn5xhXk and get error

 org.hibernate.exception.JDBCConnectionException: Getting database metadata
Getting database metadata
java.sql.SQLException: No suitable driver found for   jdbc:postgresql:localhost:5632:postgis_test
No suitable driver found for jdbc:postgresql:localhost:5632:postgis_test
java.sql.SQLException: No suitable driver found for jdbc:postgresql:localhost:5632:postgis_test
No suitable driver found for jdbc:postgresql:localhost:5632:postgis_test

UPDATE 3

Okey. Im reinstal eclipse and get situation like in first UPDATE again. So i try generate POJO from DB and get only POJO from postgis tables: geography_columns and spatial_ref_sys. Hibernate cant work with PostGis?

Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
Kliver Max
  • 5,107
  • 22
  • 95
  • 148
  • I found some reliable answer here. http://stackoverflow.com/questions/138575/how-can-i-create-database-tables-from-xsd-files Regards – Chakradhar K Aug 14 '12 at 06:34
  • how i understand XML Spy create Db correctly? Okey in this case how to crate POJO from this DB? – Kliver Max Aug 14 '12 at 06:53
  • From the Exception in your Update2: The Postgres JDBC Driver seems not to be part of the classpath. Make sure that you've placed the Postgres JDBC driver into the classpath Hiberbernate Eclipse Plugin uses. – andih Aug 14 '12 at 07:46
  • I solve problem with update2. – Kliver Max Aug 14 '12 at 09:35

0 Answers0