[Hibernate-JIRA] Created: (HV-376) validateValue() and validateProperty() are too restrictive regarding processable property names
by Gunnar Morling (JIRA)
validateValue() and validateProperty() are too restrictive regarding processable property names
-----------------------------------------------------------------------------------------------
Key: HV-376
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-376
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Reporter: Gunnar Morling
Assignee: Hardy Ferentschik
Priority: Minor
The methods Validator#validateValue() and Validator#validateProperty() expect the name of a bean property, for which constraint validation should be performed.
Currently not all valid Java property (field/method) identifiers are supported here, as the specified property name is processed in PathImpl with a regular expression, that matches only the word character class (A-Za-z0-9_), causing the evaluation of uncommon but yet valid property names such as the following ones to fail:
* private String höchstBetrag; // German Umlaute such as "ö" are allowed in Java identifiers
* private String €Amount; // some currency signs such as "€" are allowed, sigh
* private String höchst\u00f6Betrag; // specifying letters such as "ö" using Unicode is allowed
Trying to do so results in the following exception:
{code:java}
java.lang.IllegalArgumentException: Unable to parse property path ö
at org.hibernate.validator.engine.PathImpl.parseProperty(PathImpl.java:216)
at org.hibernate.validator.engine.PathImpl.createPathFromString(PathImpl.java:64)
at org.hibernate.validator.engine.ValidatorImpl.validateValue(ValidatorImpl.java:152)
{code}
More information on the identifiers allowed in the Java language can be found in [JLS, chapter 3.8|http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8].
--
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
14 years, 2 months
[Hibernate-JIRA] Commented: (HHH-951) setMaxResults causes "ORA-00918: column ambiguously defined" exception
by Grzegorz Olędzki (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-951?page=co... ]
Grzegorz Olędzki commented on HHH-951:
--------------------------------------
Why is the issue marked as 'Awaiting test case'? Tony O'Grady submitted one, hasn't he?
> setMaxResults causes "ORA-00918: column ambiguously defined" exception
> -----------------------------------------------------------------------
>
> Key: HHH-951
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-951
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: hibernate3.0.5, hibernate3.1b2, Oracle 9
> Reporter: Karel Sommer
> Attachments: Hibernate_SQL_HHH-5579.txt, Hibernate_StackTrace_HHH-5579.txt, TestCase_for_Hibernate_Core_Issue_HHH-5579.zip
>
>
> when create criteria with associations, i get this error:
> ORA-00918: column ambiguously defined
> mapping:
> <class name="User" table="FRAME_USER" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_user_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="user_name" type="string" not-null="true"/>
> <property name="blocked" type="yes_no" not-null="true"/>
> <property name="access_logon" type="timestamp"/>
> <property name="denied_logon" type="timestamp"/>
> <property name="inactivity_time" type="long"/>
> <property name="session_count" type="long"/>
> <idbag name="terminalGroups" table="FRAME_USER_TERMINAL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long">
> <generator class="sequence">
> <param name="sequence">frame_user_terminal_seq</param>
> </generator>
> </collection-id>
> <key column="id_user"/>
> <many-to-many column="id_terminal_groups" class="TerminalGroup" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="TerminalGroup" table="FRAME_TERMINAL_GROUPS" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_groups_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="name" column="group_name" type="string" not-null="true"/>
> <idbag name="terminals" table="FRAME_TERMINAL_REL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long" >
> <generator class="sequence">
> <param name="sequence">frame_terminal_rel_seq</param>
> </generator>
> </collection-id>
> <key column="id_term_group"/>
> <many-to-many column="id_term" class="Terminal" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="Terminal" table="FRAME_TERMINAL" where="status != 'D'" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="status" type="char" not-null="true"/>
> <property name="mac" type="string" not-null="true"/>
> <property name="name" column="ident" type="string" not-null="true"/>
> <property name="description" type="string"/>
> code:
> session.createCriteria(User.class)
> .add(Restrictions.like("user_name", "%")
> .createCriteria("terminalGroups")
> .add( Restrictions.like("group_name", "%").
> .setProjection(Projections.rowCount())
> .uniqueResult();
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-5057) ScrollableResults does not fetch many-to-many collections
by Jérôme Van Der Linden (JIRA)
ScrollableResults does not fetch many-to-many collections
---------------------------------------------------------
Key: HHH-5057
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5057
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Reporter: Jérôme Van Der Linden
Priority: Blocker
I have a many-to-many relation between two objects :
{code:title=Project.java|borderStyle=solid}
@Entity
public class Project {
private List<Viperson> managers;
@ManyToMany(targetEntity = Viperson.class)
@JoinTable(name = "PRJMANAGER", joinColumns = @JoinColumn(name = "PROJECTID", nullable = false), inverseJoinColumns = @JoinColumn(name = "VIPID", nullable = false))
public List<Viperson> getManagers() {
return managers;
}
}
{code}
{code:title=Viperson.java|borderStyle=solid}
@Entity
public class Viperson {
private List<Project> projects;
@ManyToMany(mappedBy = "managers", targetEntity = Project.class)
public List<Project> getProjects() {
return projects;
}
}
{code}
And the following test (actually, it is a code from spring batch HibernateCursorItemReader I put in a testcase) :
{code}
@Test
public void testSelectAll() {
StatelessSession statelessSession = sessionFactory.openStatelessSession();
ScrollableResults cursor = statelessSession.createQuery("from Project").scroll();
Object[] data = null;
if (cursor.next()) {
data = cursor.get();
}
}
{code}
data contains a {{Project}} but {{managers}} field is *null*, +even if I add eager fetching+. I have also a {{OneToMany}} in the {{Project}} class. This one is well loaded (i have a {{PersistentBag}}).
Is there anything I miss ? I suspect a bug on that.
--
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
14 years, 2 months
[Hibernate-JIRA] Commented: (HHH-514) getDatabaseMajorVersion unsupported by some Oracle drivers
by David Lee Lambert (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-514?page=co... ]
David Lee Lambert commented on HHH-514:
---------------------------------------
Bug still present in hibernate 3.6 ... I just ran into it. I have the Oracle 10g driver lying around here somewhere, but it's still annoying. Shouldn't there be some way to catch this exception and fall back to the "9i" behavior?
> getDatabaseMajorVersion unsupported by some Oracle drivers
> ----------------------------------------------------------
>
> Key: HHH-514
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-514
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.4
> Environment: WLS 8.1 SP2, Hibernate 3.0.4, Oracle9i Enterprise Edition Release 9.2.0.4.0, Oracle JDBC driver 9.2.0.3.0
> Reporter: Mathias Bogaert
> Priority: Critical
>
> Put an extra try catch around databaseMajorVersion = meta.getDatabaseMajorVersion(); in SettingsFactory (change occured in version 1.31) and handle 0 value in DialectFactory.buildDialect.
> WARN - Could not obtain connection metadata
> java.sql.SQLException: Kenmerk wordt niet ondersteund.
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
> at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:690)
> at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4451)
> at weblogic.jdbc.wrapper.DatabaseMetaData_oracle_jdbc_driver_OracleDatabaseMetaData.getDatabaseMajorVersion(Unknown Source
> )
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
--
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
14 years, 2 months
[Hibernate-JIRA] Commented: (HHH-951) setMaxResults causes "ORA-00918: column ambiguously defined" exception
by Piotr Findeisen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-951?page=co... ]
Piotr Findeisen commented on HHH-951:
-------------------------------------
Forgot to add: all queries are executed with {{setMaxResults(20)}}. Without it, everything is fine.
> setMaxResults causes "ORA-00918: column ambiguously defined" exception
> -----------------------------------------------------------------------
>
> Key: HHH-951
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-951
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: hibernate3.0.5, hibernate3.1b2, Oracle 9
> Reporter: Karel Sommer
> Attachments: Hibernate_SQL_HHH-5579.txt, Hibernate_StackTrace_HHH-5579.txt, TestCase_for_Hibernate_Core_Issue_HHH-5579.zip
>
>
> when create criteria with associations, i get this error:
> ORA-00918: column ambiguously defined
> mapping:
> <class name="User" table="FRAME_USER" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_user_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="user_name" type="string" not-null="true"/>
> <property name="blocked" type="yes_no" not-null="true"/>
> <property name="access_logon" type="timestamp"/>
> <property name="denied_logon" type="timestamp"/>
> <property name="inactivity_time" type="long"/>
> <property name="session_count" type="long"/>
> <idbag name="terminalGroups" table="FRAME_USER_TERMINAL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long">
> <generator class="sequence">
> <param name="sequence">frame_user_terminal_seq</param>
> </generator>
> </collection-id>
> <key column="id_user"/>
> <many-to-many column="id_terminal_groups" class="TerminalGroup" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="TerminalGroup" table="FRAME_TERMINAL_GROUPS" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_groups_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="name" column="group_name" type="string" not-null="true"/>
> <idbag name="terminals" table="FRAME_TERMINAL_REL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long" >
> <generator class="sequence">
> <param name="sequence">frame_terminal_rel_seq</param>
> </generator>
> </collection-id>
> <key column="id_term_group"/>
> <many-to-many column="id_term" class="Terminal" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="Terminal" table="FRAME_TERMINAL" where="status != 'D'" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="status" type="char" not-null="true"/>
> <property name="mac" type="string" not-null="true"/>
> <property name="name" column="ident" type="string" not-null="true"/>
> <property name="description" type="string"/>
> code:
> session.createCriteria(User.class)
> .add(Restrictions.like("user_name", "%")
> .createCriteria("terminalGroups")
> .add( Restrictions.like("group_name", "%").
> .setProjection(Projections.rowCount())
> .uniqueResult();
--
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
14 years, 2 months
[Hibernate-JIRA] Commented: (HHH-951) setMaxResults causes "ORA-00918: column ambiguously defined" exception
by Piotr Findeisen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-951?page=co... ]
Piotr Findeisen commented on HHH-951:
-------------------------------------
I have the same problem when using Hibernate 3.5.3 or 3.6.1 with Oracle 10g.
I have two entities {{S}} and {{T}}. {{S.t}} references (many-to-one) {{T}}.
Following JPQL queries work fine:
{noformat}
select s, 1 as one from S s
select s from S s inner join fetch S.t as t
{noformat}
But this one fails
{noformat}
select s, 1 as one from S s inner join fetch S.t as t
{noformat}
In SQL generated from the last one mentions {{T.id}} twice with the same alias.
> setMaxResults causes "ORA-00918: column ambiguously defined" exception
> -----------------------------------------------------------------------
>
> Key: HHH-951
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-951
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: hibernate3.0.5, hibernate3.1b2, Oracle 9
> Reporter: Karel Sommer
> Attachments: Hibernate_SQL_HHH-5579.txt, Hibernate_StackTrace_HHH-5579.txt, TestCase_for_Hibernate_Core_Issue_HHH-5579.zip
>
>
> when create criteria with associations, i get this error:
> ORA-00918: column ambiguously defined
> mapping:
> <class name="User" table="FRAME_USER" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_user_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="user_name" type="string" not-null="true"/>
> <property name="blocked" type="yes_no" not-null="true"/>
> <property name="access_logon" type="timestamp"/>
> <property name="denied_logon" type="timestamp"/>
> <property name="inactivity_time" type="long"/>
> <property name="session_count" type="long"/>
> <idbag name="terminalGroups" table="FRAME_USER_TERMINAL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long">
> <generator class="sequence">
> <param name="sequence">frame_user_terminal_seq</param>
> </generator>
> </collection-id>
> <key column="id_user"/>
> <many-to-many column="id_terminal_groups" class="TerminalGroup" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="TerminalGroup" table="FRAME_TERMINAL_GROUPS" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_groups_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="name" column="group_name" type="string" not-null="true"/>
> <idbag name="terminals" table="FRAME_TERMINAL_REL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long" >
> <generator class="sequence">
> <param name="sequence">frame_terminal_rel_seq</param>
> </generator>
> </collection-id>
> <key column="id_term_group"/>
> <many-to-many column="id_term" class="Terminal" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="Terminal" table="FRAME_TERMINAL" where="status != 'D'" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="status" type="char" not-null="true"/>
> <property name="mac" type="string" not-null="true"/>
> <property name="name" column="ident" type="string" not-null="true"/>
> <property name="description" type="string"/>
> code:
> session.createCriteria(User.class)
> .add(Restrictions.like("user_name", "%")
> .createCriteria("terminalGroups")
> .add( Restrictions.like("group_name", "%").
> .setProjection(Projections.rowCount())
> .uniqueResult();
--
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
14 years, 2 months