[hibernate-dev] HHH-3244 supporting unicode literal type
Steve Ebersole
steve at hibernate.org
Tue Sep 6 15:20:05 EDT 2011
The better option in my opinion is a specific annotation ala
@Nationalized (https://hibernate.onjira.com/browse/HHH-5869). AFAIR We
were trying to see if the JPA expert group wanted to address this as
well and fall in line with whatever solution they decided on if so.
Probably best to just move forward with ours and deal with the
javax.persistence solution if/when it comes about.
On 09/06/2011 11:58 AM, Strong Liu wrote:
> Hi there,
>
> as you know JDBC 4.0 now support unicode literal type, like NCHAR, NVARCHAR, NCLOB, LONGNVARCHAR.
> and there are lots of jiras asking we support these new types.
>
> it is easy to create hibernate types for these jdbc type, for example, i have a UnicodeStringType, so
>
> @Entity
> class Person{
> @Id
> Long id;
> @Type('unicode-string-type')
> String name;
> }
>
> Query query = session.createQuery("from Person p where p.name = :name")
> query.setUnicodeString('name','刘少壮')
>
> is this okay? and any suggestions?
>
> -----------
> Strong Liu<stliu at hibernate.org>
> http://hibernate.org
> http://github.com/stliu
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
--
steve at hibernate.org
http://hibernate.org
More information about the hibernate-dev
mailing list