I am trying to create a data access layer where an application would like to use both a traditional SQL store as well as a NoSQL store. After few searches, I have found a concept like Spring Data MongoDB cross strore and this concept similar to my requirement. So that, I have successfully configured as suggested in the reference document https://stackoverflow.com/a/13998825.
But I am getting below error when I test the above sample. Can some one please help in this regard...
Error: Caused by: org.hibernate.MappingException: Could not determine type for: com.hcc.riab.model.ProductInfo, at table: Product, for columns: [org.hibernate.mapping.Column(productInfo)]
Related
I am trying to map the result of a stored procedure to an entity list and I am guided by the following post https://www.baeldung.com/jpa-sql-resultset-mapping .
Now I am having the next error:
org.hibernate.procedure.UnknownSqlResultSetMappingException: The given
SqlResultSetMapping name [Unknown SqlResultSetMapping [Foo]] is
unknown
I suspect that the problem could be that I am working with several databases in my project.
How could I specify the context or persistence unit in which the resultMapping is?
I have 2 entities as batch & batchDetailEntity. I try to insert records to my database postgresql using spring boot reactor r2dbcEntityTemplate.insert() & I am getting error like Nested entities are not supported.
My code
Error
Instead of insert(Mono.just(batchDetailEntity))
put insert(batchDetailEntity) It may work for you.
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?
I have this error when trying to generate the meta model with JOOQ:
org.jooq.exception.DataAccessException: SQL [select [SYS].[SYSUSER].[user_name] from [SYS].[SYSUSER]]; SYS.SYSUSER not found.
It's probably because the user does not have administration rights.
Can JOOQ generate metamodel code from create statements?
I don't have another user. Any suggestions?
You're probably using the wrong database as understood by jOOQ, as documented here:
http://www.jooq.org/manual/META/Configuration/
Note, how the documentation states:
<!-- The database dialect from jooq-meta. Available dialects are
named org.util.[database].[database]Database. Known values are:
org.jooq.util.ase.ASEDatabase
[...]
org.jooq.util.sybase.SybaseDatabase
You can also provide your own org.jooq.util.Database implementation
here, if your database is currently not supported -->
<name>org.jooq.util.oracle.OracleDatabase</name>
The SQL you've mentioned seems to be from the SybaseDatabase class (which corresponds to Sybase SQL Anywhere), whereas you should use the ASEDatabase class instead, generating calls to sp_help
I have a column in a PostgreSql database that is defined with type boolean[]. I wish to map this to a Java entity property using Hibernate 3.3.x. However, I cannot find a suitable Java type that Hibernate is happy to map to. I thought that the java.lang.Boolean[] would be the obvious choice, but Hibernate complains:
Caused by: org.hibernate.HibernateException:
Wrong column type in schema.table for column mycolumn. Found: _bool, expected: bytea
at org.hibernate.mapping.Table.validateColumns(Table.java:284)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1130)
I have also tried the following property types without success:
java.lang.String
java.lang.boolean[]
java.lang.Byte[]
How can I map this column?
You need to implement your own UserType. This article is very handy. I am including this link because the link in the original article is broken.
You can implement your customer user types by overriding some open source UserTypes