[Hibernate-JIRA] Created: (HHH-3461) Enhance DialectFactory to support Sybase Adaptive Server Anywhere
by Jason Stern (JIRA)
Enhance DialectFactory to support Sybase Adaptive Server Anywhere
-----------------------------------------------------------------
Key: HHH-3461
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3461
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6.GA, Sybase Adaptive Server Anywhere
Reporter: Jason Stern
Priority: Minor
Currently, the org.hibernate.dialect.DialectFactory class has native support for Sybase Adaptive Server Enterprise (ASE), but throws the following exception when used with Sybase Adaptive Server Anywhere (ASA):
"org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: Adaptive Server Anywhere"
I have manually set the dialect for now, but if you could add the following line of code to the DialectFactory class, it would help with future portability:
MAPPERS.put( "Adaptive Server Anywhere", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseAnywhereDialect" ) );
Thanks for all your hard work!
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-3731) ConstraintViolationException logged at level ERROR instead of WARN or INFO
by Jonathan Amir (JIRA)
ConstraintViolationException logged at level ERROR instead of WARN or INFO
--------------------------------------------------------------------------
Key: HHH-3731
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3731
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: hibernate core jar specifies 3.2.6 in META-INF folder. database is oracle 10.2. OS is Win XP
Reporter: Jonathan Amir
Priority: Minor
Attachments: stacktrace.txt
Please see this thread for an example and an explanation of the problem:
http://forums.hibernate.org/viewtopic.php?p=2258025&sid=cdcf98f3e9026fad9...
Basically, it is a valid use-case for a developer to insert a record to the db and to try and catch a ConstraintViolationException. Upon catching it, it should be the developer's choice regarding what to do, how to recover, etc., and also how to log it.
However, Hibernate logs the error before throwing it, and at log level ERROR, no less, thus polluting the log files with superfluous messages. It is not practical to log messages at this Level. The offending class is AbstractFlushingEventListener.java (I'm attaching a stacktrace to illustrate).
Please reduce the log level of this message to WARN or INFO.
There's also a sort of philosophical argument for this request. Some may argue, like in the reply in the linked thread above, that a constraint violation is an error, thus it should be logged as one. However, that is an application-domain error, not a hibernate error. Hibernate is a library, and as such it should conform to user's requirements. First, it should use the ERROR level only to log real errors related to Hibernate's functionality as a library. Secondly, it should aim to give the user maximum flexiblity and control with regards to logging.
(Not withstanding the previous statement, logging application problems is, of course, very helpful for debugging, but it should be at a lower log level)
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-3891) one-to-one with property-ref always non-lazy
by Sandeep Vaid (JIRA)
one-to-one with property-ref always non-lazy
--------------------------------------------
Key: HHH-3891
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3891
Project: Hibernate Core
Issue Type: Bug
Components: core
Reporter: Sandeep Vaid
I have one-to-one relationship betnwee 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.
--
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, 4 months
[Hibernate-JIRA] Created: (HHH-2988) UnionSubclassEntityPersister.generateSubquery() does not use column.getQuotedName()
by benoit heinrich (JIRA)
UnionSubclassEntityPersister.generateSubquery() does not use column.getQuotedName()
-----------------------------------------------------------------------------------
Key: HHH-2988
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2988
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Reporter: benoit heinrich
Priority: Critical
Hi all,
I'm new to hibernate and I'm trying to use the Inheritance strategy TABLE_PER_CLASS with a Postgres database.
The postgres database contains tables and column with upper cases names (names must be quoted).
In the entity I used the back-quote ` sign to quote the table names and column names.
All basic requests work but when I have an association going to the virtual parent table then I got an error due to the fact that the Union subclass entity persister does not quote the column names inside the sub query.
I've locate the problem and I think it occurs here:
org.hibernate.persister.entity.UnionSubclassEntityPersister.java (svn rev. 11398)
line 395 ------------------------------------------------------------------------------------------------
while ( citer.hasNext() ) {
Column col = (Column) citer.next();
if ( !table.containsColumn(col) ) {
int sqlType = col.getSqlTypeCode(mapping);
buf.append( dialect.getSelectClauseNullString(sqlType) )
.append(" as ");
}
buf.append( col.getName() );
buf.append(", ");
But should be ------------------------------------------------------------------------------------------------
buf.append( col.getQuotedName() );
Here is an example to test:
Item.java:
---------------------------------
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Item implements java.io.Serializable {
private long id;
private Container parent;
/** getter / setter */
@Id
@Column(name = "`ID`", unique = true, nullable = false, insertable = true, updatable = true)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "item_id_seq_generator")
@SequenceGenerator(name="item_id_seq_generator", sequenceName="item_id_seq", allocationSize=1)
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "`ParentID`", unique = false, nullable = true, insertable = true, updatable = true)
public Container getParent() {
return this.parent;
}
public void setParent(Container parent) {
this.parent = parent;
}
}
Container.java
---------------------------------
@Entity
@Table(name = "`CoNTaiNeR`")
public class Container extends Item {
private Set<Item> items = new HashSet<Item>(0);
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "parent", targetEntity = Item.class)
public Set<Item> getItems() {
return this.items;
}
public void setItems(Set<Item> items) {
this.items = items;
}
}
SimpleItem.java
---------------------------------
@Entity
@Table(name = "`SimpleItem`")
public class SimpleItem extends Item {
/*...*/
}
So when you try to get the Container.getItems() then it generates the wrong query.
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
15 years, 4 months
[Hibernate-JIRA] Created: (HSEARCH-218) add indexAll( Class type ) to rebuild indexes from all data
by Sanne Grinovero (JIRA)
add indexAll( Class type ) to rebuild indexes from all data
-----------------------------------------------------------
Key: HSEARCH-218
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-218
Project: Hibernate Search
Issue Type: New Feature
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
The implementation should be as efficient as possible,
to cover this scenarios:
* Developers change an entity and want to test the effect on the index structure,
they want do to search experiments with the new fields.
* A production system is up(down)graded to a new(old) release,
involving index changes.
(the system is "down for maintenance" but the speed is crucial)
* Existing index is corrupted/lost. (Again, speed to recover is critical)
* A Database backup is restored, or data is changed by other jobs.
* Some crazy developer like me prefers to disable H.Search's event
listeners for some reason.
(I wouldn't generally recommend it, but have met other people who
have a reasonable argument to do this)
* A Lucene update breaks the index format (not so irrationale as they just did on trunk).
--
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, 4 months