[Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
Gail Badner commented on HHH-1483:
----------------------------------
Lars, the relevant mappings were added to MySQLDialect and MySQL5Dialect, not Dialect. Did you run into problems using MySQLDialect or MySQL5Dialect?
> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
> Key: HHH-1483
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: MySQL 5.0.18-nt
> Reporter: Sergey Vladimirov
> Priority: Minor
> Attachments: hhh-1483-patch.txt
>
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO | MUL | | |
> | answpos | int(11) | NO | | | |
> | answer | text | YES | | NULL | |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO | | 0 | |
> | answer | text | YES | | NULL | |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3420) MatchMode doesn't escape wildcard characters
by Hontvári József (JIRA)
MatchMode doesn't escape wildcard characters
--------------------------------------------
Key: HHH-3420
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3420
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.2
Environment: MySQL
Reporter: Hontvári József
Priority: Minor
One can think that by specifying e.g. MatchMode.START in a "like" restriction Hibernate takes care of escaping SQL LIKE wildcard characters in the supplied pattern. It doesn't, actually Hibernate only inserts a % before the first character.
I am not sure what was the intent of the original author (Gavin King), so the issue may only be missing documentation. However I don't see any other useful purpose of this class then providing database independent escaping. It seems that all databases use the % wildcard, so there is no need to provide database indpeendence to that.
It can be argued that this might create a security problem for an unaware developer, so I set issue type to bug.
--
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, 1 month
[Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1
by Lars Michele (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=c... ]
Lars Michele commented on HHH-1483:
-----------------------------------
The problem still remains in trunk. In Dialect.java the type LONGVARCHAR has to be registered as stated in other comments above.
So in the constructor Dialect() add something like:
registerHibernateType( Types.LONGVARCHAR, Hibernate.TEXT.getName() );
The same applies for LONGVARBINARY I think ;-)
registerHibernateType( Types.LONGVARBINARY, Hibernate.BLOB.getName() );
Regards,
Lars
> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
> Key: HHH-1483
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: MySQL 5.0.18-nt
> Reporter: Sergey Vladimirov
> Priority: Minor
> Attachments: hhh-1483-patch.txt
>
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO | MUL | | |
> | answpos | int(11) | NO | | | |
> | answer | text | YES | | NULL | |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO | | 0 | |
> | answer | text | YES | | NULL | |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3925) Single quote in Oracle native query incorrectly maps to java Character instead of java String
by andrew zimmer (JIRA)
Single quote in Oracle native query incorrectly maps to java Character instead of java String
---------------------------------------------------------------------------------------------
Key: HHH-3925
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3925
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.2.2
Reporter: andrew zimmer
Hi Folks,
This little snippet results in a ClassCastException because Hibernate thinks that the single quote in my native query in an Oracle database should be mapped to a Character. It should map to a String.
Query q = em.createNativeQuery("select 'fuz','buz' from dual");
List<Object[]> rows = q.getResultList();
System.out.println("Value: " + rows.iterator().next()[0]);
System.out.println((String)(rows.iterator().next()[0]));
The above throws java.lang.ClassCastException: java.lang.Character.
I have figured out that using a bind variable (example below) instead does the right thing, but this seriously impairs my ability to write a plain SQL String in one method and then pass it into a general purpose method that would do a simple EntityManager.createNativeQuery().getResultList(). The general purpose "execute this piece of SQL for me" won't work because it has to be aware of the bind variables, which is exactly what I"m trying to avoid.
Query q = em.createNativeQuery("select :v1,'buz' from dual");
q.setParameter("v1","fuz");
List<Object[]> rows = q.getResultList();
System.out.println("Value: " + rows.iterator().next()[0]);
System.out.println((String)(rows.iterator().next()[0]));
regards,
andrew
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3499) NamingStrategy should support naming foreign keys and indexes
by Geoffrey De Smet (JIRA)
NamingStrategy should support naming foreign keys and indexes
-------------------------------------------------------------
Key: HHH-3499
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3499
Project: Hibernate Core
Issue Type: Improvement
Components: metamodel
Affects Versions: 3.3.1
Reporter: Geoffrey De Smet
hbm2ddl always generates foreign key constraints based on hashcodes, like this:
alter table apple add index FK365FA4BB24B1D45C (lemon_id), add constraint FK365FA4BB24B1D45C foreign key (lemon_id) references lemon (id);
Some databases don't support enough characters for foreign key names to generate a readable foreign key name, so that's a sensible default.
However, those of use that use databases like MySQL etc, would like a readable foreign key name, such as:
alter table apple add index FK_Apple_lemon (lemon_id), add constraint FK365FA4BB24B1D45C foreign key (lemon_id) references lemon (id);
We can do that by annotating every entity with @Index in JPA, or specifying it in a hbm file,
but we can't do it generally, by extending DefaultNamingStrategy or ImprovedNamingStrategy.
Here's a proposition on how we could do it:
- In the NamingStrategy interface, next to the method foreignKeyColumnName, add a method:
public String foreignKeyConstraintName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName
- DefaultNamingStrategy and ImprovedNamingStrategy should implement it as it is now, based on hashcodes.
- If a mapping has an @Index JPA annotation or it's specified in a hbm file, that override counts.
--
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, 1 month