hbm2ddl and Oracle DB: Found: number, expected: boolean
Description
Activity
Christian Beikov April 8, 2022 at 5:19 PM
I'm pretty sure this is fixed in 6.0. If this still is an issue for you, please create a new issue with a test case that reproduces the problem on the latest Hibernate version.
Steve Ebersole October 28, 2015 at 3:25 AM
As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.
Steve Ebersole October 27, 2015 at 7:14 PM
This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.
For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/
Mark Kempster November 16, 2011 at 2:24 PM
Following in the path from this question
http://stackoverflow.com/questions/7081044/hibernate-how-to-set-sql-type-by-annotation
I tried altering the annotation for a boolean column by adding the 'columnDefinition' like so
@Column(columnDefinition="number(1)", name=...)
Setting hibernate to do schema-validation with this persistence.xml property
<property name="hibernate.hbm2ddl.auto" value="validate"/>
was failing with the boolean / number mismatch but now my sample war is deploying properly.
Mark Kempster November 3, 2011 at 1:10 PM
This is reproducible by pointing the seam 3.1.0.Beta4 seam-booking example application at an oracle datasource (I used 10g) and altering the persistence.xml to make these two changes
1. <jta-data-source>java:jboss/datasources/OracleDS</jta-data-source>
2. <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
I deployed this on as7.0.2.Final and see the following log entry (prettied up)
HHH00389:Unsuccessful: create table Booking (
id number(19,0) not null,
beds number(10,0) not null,
checkinDate date,
checkoutDate date,
creditCardExpiryMonth number(10,0) not null,
creditCardExpiryYear number(10,0) not null,
creditCardName varchar2(70 char) not null,
creditCardNumber varchar2(16 char) not null,
creditCardType varchar2(255 char) not null,
smoking boolean, <-- problem column
hotel_id number(19,0) not null,
user_username varchar2(15 char) not null,
primary key (id))
It may not be a blocker use case, but I thought the seam example should deploy on as7 with oracle out of the box, as it does with hypersonic. The prior fix using hibernate's @Type doesn't appear to be available any more?
As described in this forum topic:
https://forum.hibernate.org/viewtopic.php?f=1&t=1011905&start=0
Since version 4 Hibernate (hbm2ddl) cannot map a boolean field in a JPA entity to a column with type number(1,0) in Oracle DB.