Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add way to distinguish base and partitioned tables in PgDatabas…
…eMetaData.getTables (#1708) * feat: add way to distinguish base and partitioned tables in PgDatabaseMetaData.getTables There is currently no way to distinguish between base tables and partitioned tables in the response from PgDatabadeMetaData.getTables. Fix this by adding PARTITIONED TABLE to the tableTypeClauses map and thus the TABLE_TYPE field in the query in getTables. Also update a test (testPartitionedTables) that was using TABLE_TYPE of TABLE to grab partitioned tables. This should close #1590. However, perhaps this could be considered a breaking change for anyone using getTables and expecting partitioned tables to show up for .getTables(s, s1, s2, new String[]{"TABLE"})? * test: improve database metadata table type test
- Loading branch information
Showing
2 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our product using Hibernate and postgresql. Because we have partitioned tables we got error on start:
org.hibernate.HibernateException: Missing table: TRADE_ORDER
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1335)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:175)
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:525)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:372)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:454)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:439)
Could you suggest how to use newest pgjdbc?
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to have a very small example to work with here.
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need/want code for a very simple hibernate project. I can certainly create the table
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://hibernate.atlassian.net/browse/HHH-13954?jql=text%20~%20%22partitioned%20tables%22 for how to do it
25eb32c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!