[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, 3 months
[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, 3 months
[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, 3 months