[Hibernate-JIRA] Created: (ANN-677) Blob is null with Postgresql
by Aaron Luchko (JIRA)
Blob is null with Postgresql
----------------------------
Key: ANN-677
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-677
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.2.1
Environment: hibernate-3.2.1, hibernate-annotations-3.2.1, postgresql-8.2.5-1.fc7, postgresql-jdbc-8.2.504-1jpp.fc7 and postgresql-8.2-506.jdbc4.jar
Reporter: Aaron Luchko
Attachments: hibPostgresbug.zip
I've found that after a sequence of queries, starting new transactions and clearing the session, a Blob will not be successfully from the database and null will be returned by the InputStream instead. Using the debugger I've followed this into the jdbc code and from what I can tell some message is sent to load the blob but the database replies with an empty set of data which naturally causes the InputStream to read null.
I've attached a test case (sorry, no makefile or pom.xml, I just ran it using eclipse) which, for me, replicates the bug.
Note I've also used hsqldb and mysql and didn't see the bug with them, only postgresql.
thanks,
Aaron
--
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
12 years, 1 month
[Hibernate-JIRA] Created: (JPA-8) JPA Blob feature severely lacking! It does not support java.sql.Blob interface! Any fix in Hibernate JPA?
by Colbert Philippe (JIRA)
JPA Blob feature severely lacking! It does not support java.sql.Blob interface! Any fix in Hibernate JPA?
------------------------------------------------------------------------------------------------------------
Key: JPA-8
URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-8
Project: Java Persistence API
Issue Type: Improvement
Reporter: Colbert Philippe
My issue has to do with the Blob feature under JPA. The JPA standard documentation says that : (I quote) "The Java types mappled to BLOB columns are byte[], Byte[], Serializable type, while char[], Character[] and String are mapped to CLOB".
There is an important function missing in this statement. This feature is given by JDBC and made available in Hibernate Persistence. Why is it missing in JPA? The way JPA is implemented all BLOB objects are either not-loaded into memory or completely loaded into memory. What happens when an application only wants to work with only part of the BLOB object, not the entire BLOB object?
THE MISSING FEATURE:
JDBC and Hibernate, allow for declaration of fields of type java.sql.Blob (interface). This interface has special functionality that allows an application to load only part of a BLOB object (not the entire Blob object, which can be very big) . Similarly, the Blob interface allows an application to write to only part of BLOB object (not the entire BLOB object). These two important functions are lost in JPA! That's a severe drawback!
My question is: Is there a way of going around the JPA standard and allow support for java.sql.Blob columns?
Colbert
--
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
12 years, 1 month
[Hibernate-JIRA] Created: (HBX-978) unique=true attribute of primary key in generated class prevents the schema to be regenerated
by Ali Sadik Kumlali (JIRA)
unique=true attribute of primary key in generated class prevents the schema to be regenerated
---------------------------------------------------------------------------------------------
Key: HBX-978
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-978
Project: Hibernate Tools
Issue Type: Bug
Environment: OS: Windows Vista 6.0,x86
Database: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Java VM: Java HotSpot(TM) Server VM 1.5.0_11-b03,Sun Microsystems Inc.
Eclipse Europa: Version: 3.3.0 Build id: I20070621-1340
HibernateTools-3.2.0.beta10
Reporter: Ali Sadik Kumlali
Priority: Minor
Hi,
When I reverse engineer against Oracle, unique=true attribute is added to @Column annotation of primary key column. But, when I generate schema from these generated files, Oracle throws "ORA-02261: such unique or primary key already exists in the table" error.
I first ran into this situation while trying Seam and posted the problem to Seam's forum: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116478. After I got the response, decided to try it without Seam. Then, downloaded the latest HibernateTools & Eclipse Europa and reverse engineered the schema. I saw that generated classes have unique=true attribute which clearly showed that the problem was related with HibernateTools, not with Seam.
Here is the DDL of the table against which I made my test:
CREATE TABLE PEOPLE ("ID" NUMBER NOT NULL, "SURNAME" VARCHAR2(50 BYTE), "NAME" VARCHAR2(25 BYTE), CONSTRAINT "PEOPLE_PK" PRIMARY KEY ("ID"));
Regards,
Ali Sadik Kumlali
--
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
12 years, 1 month
[Hibernate-JIRA] Created: (HHH-6639) Error using dynamic-component with JPA
by Wölfle (JIRA)
Error using dynamic-component with JPA
--------------------------------------
Key: HHH-6639
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6639
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.7
Environment: MySQL 5.0.1, Java 1.6.0_26
Reporter: Wölfle
Attachments: testJPA.tar.gz
Hi,
there seems to be a bug when using dynamic-components and an EntityManager.
When using hibernate directly, everything works fine. If using the EntityManager, the following exception is thrown, because for the dynamic attributes no members in the Entity class exist (which is the intention of dynamic-attributes, as far as I understood them).
Exception in thread "main" java.lang.IllegalArgumentException: Cannot determine java-type from given member [null]
at org.hibernate.ejb.metamodel.AttributeFactory$BaseAttributeMetadata.<init>(AttributeFactory.java:608)
at org.hibernate.ejb.metamodel.AttributeFactory$SingularAttributeMetadataImpl.<init>(AttributeFactory.java:696)
at org.hibernate.ejb.metamodel.AttributeFactory$SingularAttributeMetadataImpl.<init>(AttributeFactory.java:686)
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:559)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:93)
at org.hibernate.ejb.metamodel.AttributeFactory.getMetaModelType(AttributeFactory.java:225)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:102)
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:187)
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:66)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at test.Test.main(Test.java:24)
Attached is a tar.tz file with a sample hibernate project and a junit test that reproduces the problem.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[Hibernate-JIRA] Created: (HHH-6280) JPA criteria API don't bind numeric field
by gwa (JIRA)
JPA criteria API don't bind numeric field
-----------------------------------------
Key: HHH-6280
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6280
Project: Hibernate Core
Issue Type: Improvement
Components: entity-manager
Affects Versions: 3.6.4, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.6.0.CR2, 3.6.0.CR1, 3.5.6, 3.6.0.Beta4, 3.6.0.Beta3, 3.5.5, 3.6.0.Beta2, 3.6.0.Beta1, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0-Final, 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1
Reporter: gwa
When you use JPA criteria API, the numeric value are not binded but are directly set in the SQL instead.
eq: you have a generated SQL like:
select ... from ... where age=12;
instead of
select ... from ... where age=?;
With '12' as parameter.
when you test the following code:
{code:java}
@Entity
public class User {
@Id
private int id;
private int age;
...
}
{code}
{code:java}
CriteriaBuilder builder=em.getCriteriaBuilder();
CriteriaQuery<User> query=builder.createQuery(User.class);
Root<User> root=query.from(User.class);
query.select(root).where(builder.equal(root.get("age"),12));
em.createQuery(query).getResultList();
{code}
--
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
12 years, 1 month
[Hibernate-JIRA] Created: (HHH-5798) Is it really necessary to explicitly specifiy discriminatorValue for abstract classes?
by Oleksandr Alesinskyy (JIRA)
Is it really necessary to explicitly specifiy discriminatorValue for abstract classes?
--------------------------------------------------------------------------------------
Key: HHH-5798
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5798
Project: Hibernate Core
Issue Type: Improvement
Components: entity-manager
Affects Versions: 3.6.0
Reporter: Oleksandr Alesinskyy
At the time being if the SINGLE_TABLE inheritance strategy is used, the discriminator type is set to char and some abstract classes in the hierarchy do not have an explicit discriminator value specified the following error occurs:
{quote}
Caused by: org.hibernate.AnnotationException: Using default @DiscriminatorValue for a discriminator of type CHAR is not safe
at org.hibernate.cfg.annotations.EntityBinder.bindDiscriminatorValue(EntityBinder.java:373)
at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:200)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:586)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3977)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3931)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1368)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1345)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1477)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1096)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:685)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
{quote}
At the same time it is clear that no one row in the corresponding table may represent the abstract class, so it is absolutely safe to completely ignore abstract classes when decision is made which class is represented by a row.
--
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
12 years, 1 month