[Hibernate-JIRA] Created: (HBX-757) Add output file name, delimiter, halt on error, and format options to SchemaUpdate/<hbm2ddl>
by Dan Ports (JIRA)
Add output file name, delimiter, halt on error, and format options to SchemaUpdate/<hbm2ddl>
--------------------------------------------------------------------------------------------
Key: HBX-757
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-757
Project: Hibernate Tools
Type: Improvement
Components: ant
Versions: 3.2beta7
Reporter: Dan Ports
Priority: Minor
The file name, delimiter, halt on error, and format options are provided by SchemaExport/<hbm2ddl> already, so it makes sense to add their functionality to SchemaUpdate as well. I'll submit a patch shortly. (Is this the right place to post this, since SchemaUpdate is in the Hibernate core SVN?)
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2310) LazyInitializationException: Initializing many-to-one and one-to-one associations to a maximum of max-fetch-depth fails when using a SQLProjection on a Criteria generated Query
by Nico De Groote (JIRA)
LazyInitializationException: Initializing many-to-one and one-to-one associations to a maximum of max-fetch-depth fails when using a SQLProjection on a Criteria generated Query
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2310
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2310
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.0.5
Reporter: Nico De Groote
Priority: Critical
Initializing many-to-one and one-to-one associations to a maximum of max-fetch-depth fails when using a SQLProjection on a Criteria generated Query
Following scenario occurs.
I have a max-fetch-depth = default value.
I have a the following businessobject having the following associations.
BO -> BO2 (One to one)
BO -> list of BO3 (one to many)
I want to query for BO objects with the where clause containing a condition on one of the properties of the BO3 objects.
When I now generate my query via the Criteria API and having the following projection set to retrieve only my BO objects (and none of the outer joinables)
Projection projection = Projections.sqlProjection(
"{alias}." + primaryKeyColumn + " theObj__", new String[]{"theObj__"},
new Type[]{Hibernate.entity(BO.getClass())});
I get my BO objects but the BO2 object is not initialized, as it should ne because of the max-fetch-depth.
When not using the Projection I do get the one-to-one relation (BO2 object) as the max-fetch-depth is default value, but the query takes too much time because of the non required properties for the outerjoinable associations in the select clause.
It seams that the fetching of the many-to-one and the one-to-one associations for the max-fetch-depth is disabled when using projections.
Or am I missing the point here?
--
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, 10 months
[Hibernate-JIRA] Created: (HV-22) Provide contextual validation
by Emmanuel Bernard (JIRA)
Provide contextual validation
-----------------------------
Key: HV-22
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-22
Project: Hibernate Validator
Issue Type: New Feature
Components: engine
Reporter: Emmanuel Bernard
The basic idea is to have a special parameter in annotations named context(s)
@NotNull(message="doh", context = {"screen1Input", "screen2Input", "default"})
"default" being a special context, the one applied every time (including in the DDL)
no context or an empty context is equivalent to "default"
The regular API are running against "default"
Override the regular APIs with getInvalidValues(..., String context);
Not entirely sure the idea will float, but it sounds like a non invasive way to do it.
PS this might require to create @[Name]s annotations ie @NotNulls({@NotNull(message="m1", context="earlyStage"), @NotNull(message="m2")})
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2524) Criteria query with collection of values (Set<java.lang.String>)
by marco molinari (JIRA)
Criteria query with collection of values (Set<java.lang.String>)
----------------------------------------------------------------
Key: HHH-2524
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2524
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.2
Environment: Java VM : 1.5.0_07
DBMS : HSQLDB
Hibernate: hibernate-3.2.2.ga
Reporter: marco molinari
Hi to all,
I have a problem with Criteria query on collection of values.
Below I wrote a piece of java code and a piece of Person.hbm.xml.
I want to search all persons with the email addresses containing character '@'.
I obtain an empty list of Person and the SQL created by Criteria seems not correct ( more or less ... WHERE lower(PERSON_ID) ? ).
I search information inside Hibernate site and Hibernate book but I didn't found the solution.
public class Person
{
private Long id;
private Set<String> emailAddresses = new HashSet();
public Set<String> getEmailAddresses()
{
return emailAddresses;
}
public void setEmailAddresses(Set<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
}
public static void main(String[] args)
{
List<Person> list = session.createCriteria(Person.class)
.add( Restrictions.ilike( "emailAddresses", "@", MatchMode.ANYWHERE ) )
.list();
}
Piece of Person.hbm.xml:
<set name="emailAddresses" table="'PERSON_EMAIL_ADDR'" inverse="true">
<key column="'PERSON_ID'"/>
<element column="'EMAIL_ADDR'" type="java.lang.String" not-null="true"/>
</set>
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2622) CLONE -Fields quetes must be applied in queries to prevent mix reserved words with fields names
by Igor A Tarasov (JIRA)
CLONE -Fields quetes must be applied in queries to prevent mix reserved words with fields names
-----------------------------------------------------------------------------------------------
Key: HHH-2622
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2622
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.0 cr1
Environment: MySQL 4.1.16 Hibernate 3.2 cr1 Fedora Core 4
Reporter: Igor A Tarasov
Quotes must be appied to fields in queries.
The environment log is:
org.hibernate.cfg.Environment Hibernate 3.2 cr1
org.hibernate.cfg.SettingsFactory RDBMS: MySQL, version: 4.1.16
org.hibernate.cfg.SettingsFactory JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12
org.hibernate.dialect.Dialect Using dialect: org.hibernate.dialect.MySQLDialect
I have an entity, named Group:
@Entity
public class Group {
..
}
But, 'GROUP' is the reserved word of MySQL query language.
Log of hibernate show, that queries is without quotes:
org.hibernate.persister.entity.AbstractEntityPersister Static SQL for entity: org.dicr.isp.entity.Group
org.hibernate.persister.entity.AbstractEntityPersister Version select: select id from Group where id =?
org.hibernate.persister.entity.AbstractEntityPersister Snapshot select: select group_.id, group_.name as name0_, group_.comment as comment0_ from Group group_ where group_.id=?
org.hibernate.persister.entity.AbstractEntityPersister Insert 0: insert into Group (name, comment, id) values (?, ?, ?)
org.hibernate.persister.entity.AbstractEntityPersister Update 0: update Group set name=?, comment=? where id=?
org.hibernate.persister.entity.AbstractEntityPersister Delete 0: delete from Group where id=?
org.hibernate.persister.entity.AbstractEntityPersister Identity insert: insert into Group (name, comment) values (?, ?)
And this make a critical error in program logic:
org.hibernate.tool.hbm2ddl.DatabaseMetadata table not found: Group
ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate Unsuccessful: create table Group (id bigint not null auto_increment, name varchar(255) not null unique, comment varchar(255), primary key (id))
ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group (id bigint not null auto_increment, name varchar(255) not null unique, com' at line 1
[2006-04-27 23:57:23,895] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate schema update complete
The query: "create table Group (id bigint ..." is not correct.
Must be: "create table `Group` (`id` bigint ..."
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-2354) Schema validation too rigid for MySql enums
by Zeljko Trogrlic (JIRA)
Schema validation too rigid for MySql enums
-------------------------------------------
Key: HHH-2354
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2354
Project: Hibernate3
Type: Bug
Components: metamodel
Environment: jboss-seam-1.1.0.GA, MySQL 5
Reporter: Zeljko Trogrlic
Enum column type in MySQL is handled as CHAR in their JDBC driver and should be mapped to String Java type.
However, Hibernate expects varchar(n) and fails to do the validation.
This is how DatabaseMetaData.getColumns describes it:
DATA_TYPE=1
TYPE_NAME=enum
Note that although TYPE_NAME is enum, DATA_TYPE represents CHAR.
Hibernate reports following exception:
13:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl
13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain]
13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar(
2)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Validation should be fixed/relaxed to avoid this problem.
--
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, 11 months
[Hibernate-JIRA] Created: (EJB-277) allow string values for query hints
by Norman Richards (JIRA)
allow string values for query hints
-----------------------------------
Key: EJB-277
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-277
Project: Hibernate Entity Manager
Type: Improvement
Reporter: Norman Richards
It seems that some string values are not accepted as query hint values in hibernate. In specific, I was trying to convert a simple query that uses setHint("org.hibernate.cacheable", true) to use an XML-defined EntityQuery that uses
<framework:entity-query name="allCategories"
ejbql="select c from Category c"
order="c.name">
<framework:hints>
<key>org.hibernate.cacheable</key>
<value>true</value>
</framework:hints>
</framework:entity-query>
Unfortunately, this fails with an IllegalArgumentException:
Caused by: java.lang.IllegalArgumentException: Value for hint
at org.hibernate.ejb.QueryImpl.setHint(QueryImpl.java:160)
at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:114)
at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
...
Although I didn't try it, I would assume this would also fail from a @QueryHint in on a named query since that annotation only accepts a string
value.
I don't think this is technically a bug, but it would be very convenient if all the hints could accept string values.
--
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, 11 months