[Hibernate-JIRA] Created: (HHH-3929) one-to-one non-lazy loading but Filters Not Applied.
by Sandeep Vaid (JIRA)
one-to-one non-lazy loading but Filters Not Applied.
-----------------------------------------------------
Key: HHH-3929
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3929
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.3.1
Reporter: Sandeep Vaid
We all know that one-to-one associations are non-lazly fetched but during this fetching the filters are not applied.
I debugged hibernate code and found that hibernate finally calls EntityLoader.loadByUniqueKey() method:
public Object loadByUniqueKey(SessionImplementor session, Object key)
throws HibernateException {
return load(session, key, null, null);
}
I can understand that why filters are not applied because all one-to-one association is automatically non-lazyly fetched
and user may not have specified to fetch this associations and hence not enabled corresponding filters on session and also
not provided filter parameters.
For my case it is very important that i always apply filter as in my case if i don't apply filters, it will return me more than one record as i have one-to-one assocition at Domain model level but
same association is one-to-many at database level and by applying filter i make this one-to-many association at database level as
one-to-one association at Domain model.
Is there somehow, i can apply filters always to one-to-one association or better don;t even create a proxy of one-to-one assocaitons that
i have not asked for?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by Lars Michele (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
Lars Michele commented on HHH-1483:
-----------------------------------
The mapping from Hibernate to MySQL works, but the mapping from MySQL to Hibernate does not work. Hibernate does not know, how to map a LONGVARCHAR column returned by a native query, thats why you have to use registerHibernateType. When adding the mapping to Dialect, everything works as expected.
Regards,
Lars
> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
> Key: HHH-1483
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: MySQL 5.0.18-nt
> Reporter: Sergey Vladimirov
> Priority: Minor
> Attachments: hhh-1483-patch.txt
>
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO | MUL | | |
> | answpos | int(11) | NO | | | |
> | answer | text | YES | | NULL | |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO | | 0 | |
> | answer | text | YES | | NULL | |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-3928) Oracle Sequence grows inconsistently
by Tschungel Buch (JIRA)
Oracle Sequence grows inconsistently
------------------------------------
Key: HHH-3928
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3928
Project: Hibernate Core
Issue Type: Bug
Environment: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
JBoss_SOA_Platform 4.3.GA
org.springframework.orm.hibernate3
Reporter: Tschungel Buch
I have a view which is accessing a sequence via a function call within the view.
The call in the view looks like below:
CREATE VIEW vw_hibernate_test AS
SELECT fr.id ID,
CASE WHEN LAG (fr.id) OVER (ORDER BY fr.id) = fr.id
THEN
LPAD (xmt_edi.f_get_seq_edi_isa_value (0), 9, '0')
ELSE
LPAD (xmt_edi.f_get_seq_edi_isa_value (1), 9, '0')
END isa13
FROM funding_report fr
WHERE issue_date > SYSDATE-100
;
Now this works as expected when called within oracle, but when calling the same via the JBOSS hibernate layers the sequece starts to grow leaving gaps in between the sequence, normally after 11 correct sequences there is a gap of 2.
Is there anything I missed in the configuration of hibernate?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-3927) one-to-one with property-ref always non-lazy
by Sandeep Vaid (JIRA)
one-to-one with property-ref always non-lazy
--------------------------------------------
Key: HHH-3927
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3927
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.3.1
Reporter: Sandeep Vaid
I have one-to-one relationship between Product and ProductBasic.
<one-to-one name="productBasic" cascade="save-update" property-ref="activeProduct" lazy="proxy">
<formula>'1'</formula>
<formula>PRODUCTID</formula>
</one-to-one>
ProductBasic.hbm.xml as :
<properties name="activeProduct">
<property name="Code" column="CODE"></property>
<property name="pId" column="PID" insert="false" update="false"></property>
</properties>
When i am using property-ref, and try to load Product, it eagerly fetches ProductBasic also as :
select *
from PRODUCT productbo0_ left outer join PRODUCTPERIOD productbas1_ on '18'=productbas1_.CODE and productbo0_.PID=productbas1_.PID where productbo0_.PID=?
NOTE: Along with Product, ProductBasic is also fetched in a single query.
Even if i add constrained="true" in one-to-one mapping, the query gets fired as :
select * from PRODUCT productbo0_ where productbo0_.PID=?
select * from PRODUCTBASIC productbas0_ where productbas0_.CODE=? and productbas0_.PID=?
NOTE: Along with Product, ProductBasic is also fetched in a different query.
BUT in both these cases, ProductBasic is fetched always (non-lazy)..
How can i fetch ProductBasic in a Non-Lazy manner in this case.
I have this requirement because i use filter on ProductBasic. and now when this ProductBasic is fetched always (non-lazyly) it doesn't
apply my filter.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-3926) Restrictions.ne("field", value) creates incorrect SQL if value has a composite key
by Thomas Dietmaier (JIRA)
Restrictions.ne("field", value) creates incorrect SQL if value has a composite key
----------------------------------------------------------------------------------
Key: HHH-3926
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3926
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1.GA, Hibernate Annotations 3.4.0, J2EE SDK 5_05, example is in HSQL, problem was originally found on oracle with hibernate 3.2.6.GA
Reporter: Thomas Dietmaier
Priority: Minor
Attachments: CompositeNotEqual.zip
When applying Restrictions.ne for a value object where the entity has a composite ID
Criteria ca = session.createCriteria(Container.class);
ca.add(Restrictions.ne("thing", a));
Hibernate generates the following SQL:
Hibernate: select this_.id as id1_1_, this_.thing_item as thing2_1_1_, this_.thing_tenant as thing3_1_1_, thing2_.item as item0_0_, thing2_.tenant as tenant0_0_ from Container this_ left outer join Thing thing2_ on this_.thing_item=thing2_.item and this_.thing_tenant=thing2_.tenant where (this_.thing_item<>? and this_.thing_tenant<>?)
... which should probably be
[...] where (this_.thing_item<>? OR this_.thing_tenant<>?)
sources attached
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month