[Hibernate-JIRA] Created: (HBX-1086) Support SpringJPAConfiguration
by John Turner (JIRA)
Support SpringJPAConfiguration
------------------------------
Key: HBX-1086
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1086
Project: Hibernate Tools
Issue Type: New Feature
Components: ant
Affects Versions: 3.2.0.GA
Reporter: John Turner
I'm working on a module based approach to developing a persistence layer for a web application.
One of the things I want to be able to do is deploy each module in its own jar file with a corresponding persistence.xml file. Having done this spring's PersistenceUnitManager detects the persistence.xml files at runtime and merges the persistence configuration files into a single persistence configuration.
Problem is, at build time, I use hibernate tools and jpa configuration to build drop and create schema ddl. This just picks up the first persistence.xml on the classpath and uses it to provide the jpa configuration. I would like to see a SpringJPAConfiguration that operates in the same way as the PersistenceUnitManager.
--
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
16 years, 4 months
[Hibernate-JIRA] Updated: (HBX-524) Reverse of one-to-one relationships
by Anthony Patricio (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-524?page=co... ]
Anthony Patricio updated HBX-524:
---------------------------------
Attachment: HBX-524.patch
annotation generation is ok.
About reveng.xml: one to one generation can be controlled using
<many-to-one exclude="true"/>
<set exclude="true"/>
many-to-one actually handles the owning side of a fk
set actually handles the reverse side of a fk
TODO:
1- Max confirm this is not an _accident_ and validate the behavior
2- if ok, then I'll create <one-to-one/> and <reverse-one-to-one/> or <constrained-one-to-one/> xml element that will adopt the same behavior except the following rule: if <one-to-one excluse = true /> then <constrained-one-to-one/> will be automatically excluded
> Reverse of one-to-one relationships
> -----------------------------------
>
> Key: HBX-524
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-524
> Project: Hibernate Tools
> Issue Type: Bug
> Components: reverse-engineer
> Affects Versions: 3.1beta2
> Environment: HIbernate 3.1, Oracle 9i
> Reporter: Andrea Cattani
> Assignee: Anthony Patricio
> Attachments: HBX-524.patch, one-to-one-marcio.patch, patch.txt
>
>
> Hi,
> I've posted this issue to the forum and got this response from Max, Hibernate Team:
> "the reveng tools does not detect this as a one-to-one. it probably could, so add a request/patch to jira."
> The problem I've faced is the following:
> I have two tables, let's say
> - table A with column ID (PK) and other fields
> - table B with column ID (PK) and other fields
> table B has a foreign key constraint against table A, from column ID to column ID (one-to-one)
> When I reverese the tables with the HibernateTools I have such a resultant mapping for table B:
> <class name="B" table="B" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned" />
> </id>
> <[b]many-to-one name[/b]="a" class="A" update="false" insert="false" fetch="select">
> <column name="ID" length="12" not-null="true" unique="true" />
> </many-to-one>
> ....
> And this one for table A:
> <class name="A" table="A" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned"/>
> </id>
> <set name="b" inverse="true">
> <key>
> <column name="ID" length="12" not-null="true" unique="true" />
> </key>
> <[b]one-to-many[/b] class="B" />
> </set>
> </class>
> while I was expecting something like:
> [i]<one-to-one name="a" class="A" constrained="true"/>[/i]
> in table B, and the same (or nothing) in table A
> Thank you
> Andi
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-3450) Include SingletonEhCacheProvider as an additional caching provider
by Greg Luck (JIRA)
Include SingletonEhCacheProvider as an additional caching provider
------------------------------------------------------------------
Key: HHH-3450
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3450
Project: Hibernate3
Issue Type: Improvement
Components: caching (L2)
Affects Versions: 3.3.0.GA
Environment: Any
Reporter: Greg Luck
Attachments: SingletonEhCacheProvider.java
The SingletonEhCacheProvider complements the existing EhCacheProvider in that it is a singleton. This matches the way the provider used to work in older versions of Hibernate/Ehcache.
It is preferable to use the SingletonEhCacheProvider unless a user is running multiple versions of Hibernate (a use case we had at wotif) or multiple instances of SessionFactory. This provider is distributed with Ehcache but not with Hibernate. It would be preferable it we added it to Hibernate and it is frequently overlooked by users. This code is in production use on many systems, including those of the author.
The attached class is the one from the Ehcache project. It will need some minor tweaking to match the conventions of Hibernate project.
--
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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-2674) Query using Escape syntax in LIKE expression with PostgresSQL 8.2 results in PSQLException: The column index is out of range
by Shelly McGowan (JIRA)
Query using Escape syntax in LIKE expression with PostgresSQL 8.2 results in PSQLException: The column index is out of range
-----------------------------------------------------------------------------------------------------------------------------
Key: HHH-2674
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2674
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: JBEAP RC6 - 3.2.4.SP1_CP01
Reporter: Shelly McGowan
JPQL:
createQuery(
"select distinct Object(c) FROM Customer c, in(c.aliases) a WHERE a.alias LIKE 'sh\\_ll' escape '\\'")
.setMaxResults(NUMOFCUSTOMERS)
.getResultList();
HIBERNATE: select distinct customer0_.ID as ID3_, customer0_.NAME as NAME3_, customer0_.country as country3_, customer0_.code as code3_, customer0_.FK6_FOR_CUSTOMER_TABLE as FK5_3_, customer0_.FK5_FOR_CUSTOMER_TABLE as FK6_3_ from CUSTOMER_TABLE customer0_ inner join FKS_ALIAS_CUSTOMER aliases1_ on customer0_.ID=aliases1_.FK_FOR_CUSTOMER_TABLE inner join ALIAS_TABLE alias2_ on aliases1_.FK_FOR_ALIAS_TABLE=alias2_.ID where alias2_.ALIAS like 'sh\_ll' escape '\' limit ?
ERROR: javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute query
.
.
.
Caused by: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:52)
at org.postgresql.core.v3.SimpleParameterList.setLiteralParameter(SimpleParameterList.java:113)
at org.postgresql.jdbc2.AbstractJdbc2Statement.bindLiteral(AbstractJdbc2Statement.java:2106)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setInt(AbstractJdbc2Statement.java:1151)
at org.hibernate.loader.Loader.bindLimitParameters(Loader.java:1646)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1566)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
--
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
16 years, 4 months
[Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by Martha Cofran (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
Martha Cofran commented on HHH-1483:
------------------------------------
I've had the same issue on SqlServer and Oracle as well.
> 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
>
> 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
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-3392) Query Cache entries are not distributable
by Greg Luck (JIRA)
Query Cache entries are not distributable
-----------------------------------------
Key: HHH-3392
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3392
Project: Hibernate3
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.3.0.CR1
Environment: Any
Reporter: Greg Luck
Steve
It will correct the issue we saw.
On 17/06/2008, at 1:50 AM, Steve Ebersole wrote:
I'm asking for confirmation that said change does in fact correct the
issue :)
If it does I'll make the change in Hibernate...
On Mon, 2008-06-16 at 17:42 +1000, Greg Luck wrote:
Steve
Thanks. Why don't you make the change in Hibernate?
On 14/06/2008, at 2:40 PM, Steve Ebersole wrote:
Considering that RootEntityResultTransformer is not performing an
kind
of data uniqueing (singleton, etc) then yes that would be an issue.
There is nothing wrong with caching a query which uses a
ResultTransformer per-se.
As simple test would be to add an equals() override
to RootEntityResultTransformer where the class of the operands are
evaluated:
public boolean equals(Object other) {
// all RootEntityResultTransformers are considered equal
return other != null
&& RootEntityResultTransformer.class.isInstance( other )
}
On Tue, 2008-06-10 at 14:35 +1000, Greg Luck wrote:
Steve
I have a question from a Hibernate/Ehcache user.
When he replicates a cached Query it does not get hit on the
second
box.
I can see what the trouble is: the key includes an object
reference to
a RootEntityResultTransformer:
; transformer:
org.hibernate.transform.RootEntityResultTransformer@a725aa,
value=[4968486262001664, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
version=1,
hitCount=0, CreationTime = 1213009341528, LastAccessTime = 0 ]
So, this cannot work. How does this work for any distributed
cache?
Begin forwarded message:
From: alvins <alvins1982(a)hotmail.com>
Date: 9 June 2008 9:26:38 PM
To: ehcache-list(a)lists.sourceforge.net
Subject: [ehcache-list] Distributed ehcache - queries
I am having some problems with ehcache in distributed mode and
queries. I
have a simple spring+hibernate+ehcache webapp running on two
tomcat
servers.
I have enabled second level caching and I can see my simple pojo
gets
replicated back and forth fine between the two servers.
The query caching seems to work fine if I have a single server
started. I
can see that is using the cached query and not hitting the db.
However what
I am trying to test is if I have two boxes - box1 does query and
populates
cache which gets replicated to box2 - then box2 doesn't need to
do
query
since its in cache.
My problem is that the query from box1 is not recognized as
being
the same
as on box2 - it seems to get cached multiple times. Below is a
log
snippet
of the two objects which are in my query cache - there should
only
be one.
The first debug line is showing a query object which was
replicated
over
from another box - the second line is showing a query object
which
was
populated locally. This should not happen since they are the
same
query.
21:03:39,763 DEBUG net.sf.ehcache.store.MemoryStore -
findTopXCache:
findTopXMemoryStore hit for sql: select this_.emp_id as
emp1_2_0_,
this_.emp_firstname as emp2_2_0_, this_.emp_surname as emp3_2_0_
from
Employee this_; parameters: ; first row: 0; max rows: 10;
transformer:
org.hibernate.transform.RootEntityResultTransformer@a725aa
LOCAL: [ key = sql: select this_.emp_id as emp1_2_0_,
this_.emp_firstname as
emp2_2_0_, this_.emp_surname as emp3_2_0_ from Employee this_;
parameters: ;
first row: 0; max rows: 10; transformer:
org.hibernate.transform.RootEntityResultTransformer@a725aa,
value=[4968486262001664, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
version=1,
hitCount=0, CreationTime = 1213009341528, LastAccessTime = 0 ]
21:03:39,763 DEBUG net.sf.ehcache.store.MemoryStore -
findTopXCache:
findTopXMemoryStore hit for sql: select this_.emp_id as
emp1_2_0_,
this_.emp_firstname as emp2_2_0_, this_.emp_surname as emp3_2_0_
from
Employee this_; parameters: ; first row: 0; max rows: 10;
transformer:
org.hibernate.transform.RootEntityResultTransformer@aa11a6
LOCAL: [ key = sql: select this_.emp_id as emp1_2_0_,
this_.emp_firstname as
emp2_2_0_, this_.emp_surname as emp3_2_0_ from Employee this_;
parameters: ;
first row: 0; max rows: 10; transformer:
org.hibernate.transform.RootEntityResultTransformer@aa11a6,
value=[4968486194896896, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
version=1,
hitCount=5, CreationTime = 1213009325003, LastAccessTime =
1213009415332 ]
Does anybody have any ideas?
--
View this message in context:
http://www.nabble.com/Distributed-ehcache---queries-tp17730904p17730904.html
Sent from the Ehcache mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
ehcache-list mailing list
ehcache-list(a)lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ehcache-list
Regards
Greg Luck
web: http://gregluck.com
skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622
Regards
Greg Luck
web: http://gregluck.com
skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622
Regards
Greg Luck
web: http://gregluck.com
skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622
--
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
16 years, 4 months