[Hibernate-JIRA] Created: (HHH-6323) Duplicate SQL joins
by jose (JIRA)
Duplicate SQL joins
-------------------
Key: HHH-6323
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6323
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.6
Environment: On Ubuntu Linux with H2/Sybase databases
Reporter: jose
Priority: Blocker
Next HQL generate duplicate joins for mother table:
select a
from cat as a
join a.mother <= generates first sql join with mother table
where a.mother.name='Kitty' <= generates second sql join mother table
Same problem with this:
select a
from cat as a
join a.mother b <= generates first sql join with mother table
where a.mother.name ='Kitty' <= generates second sql join mother table
In 3.3 version detect joins name/alias used in where to avoid duplicated sql joins
Of course, forcing alias usage remove duplicate sql joins
select a
from cat as a
join a.mother b
where b.name ='Kitty'
--
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
13 years
[Hibernate-JIRA] Created: (HHH-4582) Repeated column in mapping for entity in composite id
by Franck Bisti (JIRA)
Repeated column in mapping for entity in composite id
-----------------------------------------------------
Key: HHH-4582
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4582
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1
Reporter: Franck Bisti
Priority: Minor
Attachments: PersistentClass.java
I have a composite-id with 2 manytoone. The two manytoone are composed by 3 columns each. They share 2 columns.
@Embeddable
public class FooBarId implements Serializable {
@ManyToOne()
@JoinColumns({
@JoinColumn(name="FOO_BAR1", referencedColumnName="FOO_BAR1",nullable=false, updatable=true, insertable=true),
@JoinColumn(name="FOO_BAR2", referencedColumnName="FOO_BAR2",nullable=false, updatable=true, insertable=true),
@JoinColumn(name="FOO_ID", referencedColumnName="ID",nullable=false, updatable=true, insertable=true)
})
private Foo foo;
/** Attribute*/
@ManyToOne()
@JoinColumns({
@JoinColumn(name="FOO_BAR1", referencedColumnName="FOO_BAR1",nullable=false, updatable=false, insertable=false),
@JoinColumn(name="FOO_BAR2", referencedColumnName="FOO_BAR2",nullable=false, updatable=false, insertable=false),
@JoinColumn(name="BAR_ID", referencedColumnName="ID",nullable=false, updatable=false, insertable=false)
})
private Bar bar;
Exception :
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.test.FooBar column: FOO_BAR2 (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:670)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:711)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:468)
at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:854)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
I have the "Repeated column in mapping" exception because Hibernate doesn't use the insertable and updtable property in the PersistentClass.checkColumnDuplication for composite-id.
I have modified the PersistentClass.checkColumnDuplication() by use of getColumnUpdateability code and it seems to works fine (see attached file)
I don't know if that can help
--
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
13 years
[Hibernate-JIRA] Created: (HHH-3361) LazyInitializationException generate an error message in the logs
by benoit heinrich (JIRA)
LazyInitializationException generate an error message in the logs
-----------------------------------------------------------------
Key: HHH-3361
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3361
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.3.0.CR1
Reporter: benoit heinrich
Priority: Minor
Hi,
When a LazyInitializationException is thrown a log message is automatically created by the exception class because of the line 19 in the LIE class:
LoggerFactory.getLogger( LazyInitializationException.class ).error( msg, this );
An exception should not write log messages, this is part of the application that handle the exception that should decide either or nor a log message should be created.
The exception should just carry all information with it and no more.
Actually this is causing a serious problem to one of the application I'm working on because LIE is a normal exception and is caught and handled correctly and each time a LIE is thrown by hibernate I'm getting a full stack trace in the logs (which is wrong in my case because the exception is handled correctly).
Also I don't want to change the log4j settings to ignore the LIE because I'd like to know when I get a LIE that is not caught.
So my suggestion is to simply remove the Log entry from the LIE constructor since normally this message is anyway redundant because if the exception is not caught the application will dump the exception in most of the time.
Cheers,
/Benoit
--
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
13 years
[Hibernate-JIRA] Created: (HV-490) Create @WebSafe annotation
by George Gastaldi (JIRA)
Create @WebSafe annotation
--------------------------
Key: HV-490
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-490
Project: Hibernate Validator
Issue Type: Improvement
Reporter: George Gastaldi
According to Shane Brizak statement on seam-dev list:
{quote}
Hi Gunnar,
I had an idea today for a new validation constraint called @WebSafe - in
summary what it would do is validate a rich text value provided by the
user to ensure that it contains no malicious code, such as embedded
<script> elements. The implementation for this would use JTidy to
convert the value to a DOM tree, after which it would walk the nodes of
the tree and locate any <script> tags, and if any are present the
validation would fail.
Anyway, the implementation isn't so important - what I was wondering
though is whether you think something like this would be useful to have
in the Seam Validation module. I tend to think that it would be (and we
can probably come up with quite a few other useful validation
constraints also) but I would like to know what you think about this.
Shane
{quote}
--
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
13 years