[JBoss JIRA] (HIBERNATE-108) support hibernate.hbm2ddl.auto for WAS JTA enabled environment
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-108?page=com.atlassian.jira.plu... ]
Steve Ebersole closed HIBERNATE-108.
------------------------------------
Resolution: Rejected
> support hibernate.hbm2ddl.auto for WAS JTA enabled environment
> --------------------------------------------------------------
>
> Key: HIBERNATE-108
> URL: https://issues.jboss.org/browse/HIBERNATE-108
> Project: Hibernate Integration
> Issue Type: Feature Request
> Environment: WAS 6.1, websphere 6.1, IBM VM, Windows XP
> Reporter: Peter Kovgan
> Assignee: Steve Ebersole
> Labels: WAS, autocreate, fails, jta, schema, websphere
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> ERROR SchemaExport - Unsuccessful: create sequence hibernate_sequence
> ERROR SchemaExport - ORA-02089: COMMIT is not allowed in a subordinate session
> in JTA supported environment hibernate.hbm2ddl.auto=create fails to work.
> Probably schema creation attempt made out of global transaction scope.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-108) support hibernate.hbm2ddl.auto for WAS JTA enabled environment
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-108?page=com.atlassian.jira.plu... ]
Steve Ebersole commented on HIBERNATE-108:
------------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
> support hibernate.hbm2ddl.auto for WAS JTA enabled environment
> --------------------------------------------------------------
>
> Key: HIBERNATE-108
> URL: https://issues.jboss.org/browse/HIBERNATE-108
> Project: Hibernate Integration
> Issue Type: Feature Request
> Environment: WAS 6.1, websphere 6.1, IBM VM, Windows XP
> Reporter: Peter Kovgan
> Assignee: Steve Ebersole
> Labels: WAS, autocreate, fails, jta, schema, websphere
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> ERROR SchemaExport - Unsuccessful: create sequence hibernate_sequence
> ERROR SchemaExport - ORA-02089: COMMIT is not allowed in a subordinate session
> in JTA supported environment hibernate.hbm2ddl.auto=create fails to work.
> Probably schema creation attempt made out of global transaction scope.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-109) Break hibernate-annotations.jar on server/lib into three (the original ones)
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-109?page=com.atlassian.jira.plu... ]
Steve Ebersole commented on HIBERNATE-109:
------------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
> Break hibernate-annotations.jar on server/lib into three (the original ones)
> ----------------------------------------------------------------------------
>
> Key: HIBERNATE-109
> URL: https://issues.jboss.org/browse/HIBERNATE-109
> Project: Hibernate Integration
> Issue Type: Feature Request
> Environment: Windowx XP 32 Bits
> Reporter: Rodolfo Rothganger
> Labels: Lib, Server
>
> Currently I am developing an application that includes hibernate-3.2.6.jar and hibernate annotations WITHOUT hibernate validator on a proper classloading isolation (EAR) config. Since hibernate relies on the presence of validator classes to enable/disbale validation (regardless of the classloader it´s associate with, child or parent) I had to remove the hibernate-annotations.jar from my server/lib directory and replace it with a version WITHOUT hibernate-validator.
> My request is: to break the hibernate-annotations.jar file in three (the original ones): hibernate-annotations.jar, hibernate-core-annotations.jar and hibernate-validator.jar.
> Note: the actual problem is not the presence of hibernate-validator on the classpath but the fact that this is an outdated non-compatible with hibernate 3.2.6 version.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-109) Break hibernate-annotations.jar on server/lib into three (the original ones)
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-109?page=com.atlassian.jira.plu... ]
Steve Ebersole closed HIBERNATE-109.
------------------------------------
Resolution: Rejected
> Break hibernate-annotations.jar on server/lib into three (the original ones)
> ----------------------------------------------------------------------------
>
> Key: HIBERNATE-109
> URL: https://issues.jboss.org/browse/HIBERNATE-109
> Project: Hibernate Integration
> Issue Type: Feature Request
> Environment: Windowx XP 32 Bits
> Reporter: Rodolfo Rothganger
> Labels: Lib, Server
>
> Currently I am developing an application that includes hibernate-3.2.6.jar and hibernate annotations WITHOUT hibernate validator on a proper classloading isolation (EAR) config. Since hibernate relies on the presence of validator classes to enable/disbale validation (regardless of the classloader it´s associate with, child or parent) I had to remove the hibernate-annotations.jar from my server/lib directory and replace it with a version WITHOUT hibernate-validator.
> My request is: to break the hibernate-annotations.jar file in three (the original ones): hibernate-annotations.jar, hibernate-core-annotations.jar and hibernate-validator.jar.
> Note: the actual problem is not the presence of hibernate-validator on the classpath but the fact that this is an outdated non-compatible with hibernate 3.2.6 version.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-117) Part of Composite-Id is foreign Key:How specify in Mapping?
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-117?page=com.atlassian.jira.plu... ]
Steve Ebersole commented on HIBERNATE-117:
------------------------------------------
This is an issue tracker for reporting issues, not a help forum. If you need help using Hibernate please use its forums, irc or StackOverflow. Thanks.
> Part of Composite-Id is foreign Key:How specify in Mapping?
> -----------------------------------------------------------
>
> Key: HIBERNATE-117
> URL: https://issues.jboss.org/browse/HIBERNATE-117
> Project: Hibernate Integration
> Issue Type: Feature Request
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> I have 2 classes viz. Product and ProductBasic having one-to-one relationship
>
> class Product{
> String productId;
> ProductBasic productBasic;
> }
>
> class ProductBasic{
> String productId;
> String useCode;
> TimeStamp startTime;
>
> Product product;
> }
>
> Product is mapped to a table PRODUCT which has PRODUCTID as PK.
> ProductBasic is mapped to a table PRODUCTBASIC which has PRODUCTID,USECODE and STARTTTIME as composite key.
> Also PRODUCTID (of PRODUCTBASIC table) is the foreign key referencing PRODUCT table...
>
> How can i define my one-to-one mapping considering ProductBasic.productId should get its value from Product.productId ?
>
>
> <composite-id>
> <key-property name="productId" column="PRODUCTID" type="string" length="10" />
> <key-property name="useCode" column="USECODE" type="string" length="10" />
> <key-property name="startTime" column="STARTTIME" />
> <composite-id>
>
> In this only productId is the foreign key..
>
> I am aware that i can use a <generator> tag (with class="foreign") inside <composite-id> but i guess it will generate the
> value for entire composite-id and not just a field of it.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-117) Part of Composite-Id is foreign Key:How specify in Mapping?
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-117?page=com.atlassian.jira.plu... ]
Steve Ebersole closed HIBERNATE-117.
------------------------------------
Resolution: Rejected
> Part of Composite-Id is foreign Key:How specify in Mapping?
> -----------------------------------------------------------
>
> Key: HIBERNATE-117
> URL: https://issues.jboss.org/browse/HIBERNATE-117
> Project: Hibernate Integration
> Issue Type: Feature Request
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> I have 2 classes viz. Product and ProductBasic having one-to-one relationship
>
> class Product{
> String productId;
> ProductBasic productBasic;
> }
>
> class ProductBasic{
> String productId;
> String useCode;
> TimeStamp startTime;
>
> Product product;
> }
>
> Product is mapped to a table PRODUCT which has PRODUCTID as PK.
> ProductBasic is mapped to a table PRODUCTBASIC which has PRODUCTID,USECODE and STARTTTIME as composite key.
> Also PRODUCTID (of PRODUCTBASIC table) is the foreign key referencing PRODUCT table...
>
> How can i define my one-to-one mapping considering ProductBasic.productId should get its value from Product.productId ?
>
>
> <composite-id>
> <key-property name="productId" column="PRODUCTID" type="string" length="10" />
> <key-property name="useCode" column="USECODE" type="string" length="10" />
> <key-property name="startTime" column="STARTTIME" />
> <composite-id>
>
> In this only productId is the foreign key..
>
> I am aware that i can use a <generator> tag (with class="foreign") inside <composite-id> but i guess it will generate the
> value for entire composite-id and not just a field of it.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-119) one-to-one with property-ref always non-lazy
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-119?page=com.atlassian.jira.plu... ]
Steve Ebersole commented on HIBERNATE-119:
------------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
> one-to-one with property-ref always non-lazy
> --------------------------------------------
>
> Key: HIBERNATE-119
> URL: https://issues.jboss.org/browse/HIBERNATE-119
> Project: Hibernate Integration
> Issue Type: Feature Request
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> I have one-to-one relationship between Product and ProductBasic.
> PRODUCT ------> PRODUCTID(PK)
> PRODUCT ------> PID, CODE, STARTTIME (Composite-key) and PID is FK
> In product.hbm.xml
> <one-to-one name="productBasic" cascade="save-update" property-ref="activeProduct" constrained="true">
> <formula>PRODUCTID</formula>
> </one-to-one>
>
>
> ProductBasic.hbm.xml as :
> <properties name="activeProduct">
> <many-to-one name="product" class="Product" insert="false" update="false" lazy="proxy" />
> </properties>
>
>
> When i am using property-ref, and try to load all Products, it fetches ProductBasic also as :
> select * from PRODUCT; //suppose it return 2 records with productId as 100 and 101 respectively.
> select * from PRODUCTBASIC where productId='100'
> select * from PRODUCTBASIC where productId='101'
>
> How can i fetch ProductBasic in a Non-Lazy manner in this case.
> I found few information regarding my problem as :
> https://forum.hibernate.org/viewtopic.php?f=25&t=969713
> NOTE: Without property-ref, we can load one-to-one lazily (by sepcifying constrained="true")....... outer-join="true"
> It's shows the message as :
> DEBUG - total objects hydrated: 1
> DEBUG - resolving associations for [model.Product#1]
> DEBUG - loading entity: [model.ProductName#1]
> DEBUG - creating new proxy for entity
> DEBUG - done materializing entity [model.Product#1]
>
> Now the thing now remaining in this is to load one-to-one lazily with property-ref.
> EntityType.resolve() line 382
> if ( isReferenceToPrimaryKey() ) {
> return resolveIdentifier( (Serializable) value, session );
> }
> else {
> return loadByUniqueKey( getAssociatedEntityName(), uniqueKeyPropertyName, value, session );
> }
>
> and in loadByUniqueKey() method, there is a comment :
> //TODO: implement caching?! proxies?!
>
> I think this is the culprit
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-119) one-to-one with property-ref always non-lazy
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-119?page=com.atlassian.jira.plu... ]
Steve Ebersole closed HIBERNATE-119.
------------------------------------
Resolution: Rejected
> one-to-one with property-ref always non-lazy
> --------------------------------------------
>
> Key: HIBERNATE-119
> URL: https://issues.jboss.org/browse/HIBERNATE-119
> Project: Hibernate Integration
> Issue Type: Feature Request
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> I have one-to-one relationship between Product and ProductBasic.
> PRODUCT ------> PRODUCTID(PK)
> PRODUCT ------> PID, CODE, STARTTIME (Composite-key) and PID is FK
> In product.hbm.xml
> <one-to-one name="productBasic" cascade="save-update" property-ref="activeProduct" constrained="true">
> <formula>PRODUCTID</formula>
> </one-to-one>
>
>
> ProductBasic.hbm.xml as :
> <properties name="activeProduct">
> <many-to-one name="product" class="Product" insert="false" update="false" lazy="proxy" />
> </properties>
>
>
> When i am using property-ref, and try to load all Products, it fetches ProductBasic also as :
> select * from PRODUCT; //suppose it return 2 records with productId as 100 and 101 respectively.
> select * from PRODUCTBASIC where productId='100'
> select * from PRODUCTBASIC where productId='101'
>
> How can i fetch ProductBasic in a Non-Lazy manner in this case.
> I found few information regarding my problem as :
> https://forum.hibernate.org/viewtopic.php?f=25&t=969713
> NOTE: Without property-ref, we can load one-to-one lazily (by sepcifying constrained="true")....... outer-join="true"
> It's shows the message as :
> DEBUG - total objects hydrated: 1
> DEBUG - resolving associations for [model.Product#1]
> DEBUG - loading entity: [model.ProductName#1]
> DEBUG - creating new proxy for entity
> DEBUG - done materializing entity [model.Product#1]
>
> Now the thing now remaining in this is to load one-to-one lazily with property-ref.
> EntityType.resolve() line 382
> if ( isReferenceToPrimaryKey() ) {
> return resolveIdentifier( (Serializable) value, session );
> }
> else {
> return loadByUniqueKey( getAssociatedEntityName(), uniqueKeyPropertyName, value, session );
> }
>
> and in loadByUniqueKey() method, there is a comment :
> //TODO: implement caching?! proxies?!
>
> I think this is the culprit
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-118) one-to-one with composite-id must have common CompositeId class
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-118?page=com.atlassian.jira.plu... ]
Steve Ebersole commented on HIBERNATE-118:
------------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
> one-to-one with composite-id must have common CompositeId class
> ---------------------------------------------------------------
>
> Key: HIBERNATE-118
> URL: https://issues.jboss.org/browse/HIBERNATE-118
> Project: Hibernate Integration
> Issue Type: Bug
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> One query before asking this question:
> I can see 2 different sites for Hibernate Bug Tracking:
> 1) Hibernate JIRA - http://opensource.atlassian.com/projects/hibernate/secure/Dashboard.jspa
> 2) JBOSS JIRA- This site
> Which is the official site? Out of these 2 sites on which i should post the bugs etc.. ?
> I have one-to-one relationship between Product and ProductBasic..
> I have Product (PId, PDesc) as composite-key
> I have ProductBasic (ProductId, ProductDesc) as composite-Key
> Case 1: I created one Composite class which is common for both Product and ProductBasic..
> class CompProductRelated{
> string pid;
> string pdesc;
> }
> then try to fetch Product.. It worked !!!
> Case 2: If i create seperate Composite class for Product & ProductBasic viz. CompProduct and CompProductBasic respectively as :
> class CompProduct{
> string productId;
> string productDesc;
> }
> and not if i define the mapping accordingly as:
> In Product.hbm.xml
> <composite-id name="compProduct" class="CompProduct">
> <key-property name="pid" type="string" column="PRODUCTID" length="10"></key-property>
> <key-property name="desc" type="string" column="DESC" length="10"></key-property>
> </composite-id>
> In ProductBasic.hbm.xml
> <composite-id name="compProductBasic" class="CompProductBasic">
> <key-property name="productId" column="PRODUCTID" type="string" length="10"/>
> <key-property name="productDesc" column="DESC1" type="string" length="10"/>
> </composite-id>
> Now while fetching Product (and internally it will fetch ProductBasic), it gives the following exception:
> org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class model.CompProductBasic, got class model.CompProduct
> So the only approach for one-to-one with composite-id is to have a common compositeId class..
> The link http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#map...
> recommends 3 solutions (3rd being to have a common compositeId class) but as per my understanding 1st and 2nd approach will give exception for one-to-one with composite-id ...
> I think this hibenate restriction (of having common CompositeId class for one-to-one relationship) is not good as it puts a constraint on how domain model (java) should be which could not be possible everytime in legacy applications..
> NOTE: This is the similar exception if i don't use a seperate class for CompositeId..
> Hibernate docs have a statement about this situation as :
> Unfortunately, this approach to composite identifiers means that a persistent object is its own identifier. There is no convenient "handle" other than the object itself. You must instantiate an instance of the persistent class itself and populate its identifier properties before you can load() the persistent state associated with a composite key. We call this approach an embedded composite identifier, and discourage it for serious applications.
>
> A second approach is what we call a mapped composite identifier, where the identifier properties named inside the <composite-id> element are duplicated on both the persistent class and a separate identifier class.
>
> <composite-id class="MedicareId" mapped="true">
> <key-property name="medicareNumber"/>
> <key-property name="dependent"/>
> </composite-id>
>
>
> Useful Links : https://forum.hibernate.org/viewtopic.php?f=1&t=993886
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months
[JBoss JIRA] (HIBERNATE-118) one-to-one with composite-id must have common CompositeId class
by Steve Ebersole (JIRA)
[ https://issues.jboss.org/browse/HIBERNATE-118?page=com.atlassian.jira.plu... ]
Steve Ebersole closed HIBERNATE-118.
------------------------------------
Resolution: Rejected
> one-to-one with composite-id must have common CompositeId class
> ---------------------------------------------------------------
>
> Key: HIBERNATE-118
> URL: https://issues.jboss.org/browse/HIBERNATE-118
> Project: Hibernate Integration
> Issue Type: Bug
> Reporter: Sandeep Vaid
> Assignee: Steve Ebersole
>
> One query before asking this question:
> I can see 2 different sites for Hibernate Bug Tracking:
> 1) Hibernate JIRA - http://opensource.atlassian.com/projects/hibernate/secure/Dashboard.jspa
> 2) JBOSS JIRA- This site
> Which is the official site? Out of these 2 sites on which i should post the bugs etc.. ?
> I have one-to-one relationship between Product and ProductBasic..
> I have Product (PId, PDesc) as composite-key
> I have ProductBasic (ProductId, ProductDesc) as composite-Key
> Case 1: I created one Composite class which is common for both Product and ProductBasic..
> class CompProductRelated{
> string pid;
> string pdesc;
> }
> then try to fetch Product.. It worked !!!
> Case 2: If i create seperate Composite class for Product & ProductBasic viz. CompProduct and CompProductBasic respectively as :
> class CompProduct{
> string productId;
> string productDesc;
> }
> and not if i define the mapping accordingly as:
> In Product.hbm.xml
> <composite-id name="compProduct" class="CompProduct">
> <key-property name="pid" type="string" column="PRODUCTID" length="10"></key-property>
> <key-property name="desc" type="string" column="DESC" length="10"></key-property>
> </composite-id>
> In ProductBasic.hbm.xml
> <composite-id name="compProductBasic" class="CompProductBasic">
> <key-property name="productId" column="PRODUCTID" type="string" length="10"/>
> <key-property name="productDesc" column="DESC1" type="string" length="10"/>
> </composite-id>
> Now while fetching Product (and internally it will fetch ProductBasic), it gives the following exception:
> org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class model.CompProductBasic, got class model.CompProduct
> So the only approach for one-to-one with composite-id is to have a common compositeId class..
> The link http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#map...
> recommends 3 solutions (3rd being to have a common compositeId class) but as per my understanding 1st and 2nd approach will give exception for one-to-one with composite-id ...
> I think this hibenate restriction (of having common CompositeId class for one-to-one relationship) is not good as it puts a constraint on how domain model (java) should be which could not be possible everytime in legacy applications..
> NOTE: This is the similar exception if i don't use a seperate class for CompositeId..
> Hibernate docs have a statement about this situation as :
> Unfortunately, this approach to composite identifiers means that a persistent object is its own identifier. There is no convenient "handle" other than the object itself. You must instantiate an instance of the persistent class itself and populate its identifier properties before you can load() the persistent state associated with a composite key. We call this approach an embedded composite identifier, and discourage it for serious applications.
>
> A second approach is what we call a mapped composite identifier, where the identifier properties named inside the <composite-id> element are duplicated on both the persistent class and a separate identifier class.
>
> <composite-id class="MedicareId" mapped="true">
> <key-property name="medicareNumber"/>
> <key-property name="dependent"/>
> </composite-id>
>
>
> Useful Links : https://forum.hibernate.org/viewtopic.php?f=1&t=993886
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 8 months