How to automatically convert the Integer Parameters of hql statements in ValueList by configuring

Source: Internet
Author: User
The parameters passed through queryMap of valuelist are of the string type by default. In hql of the valuelist configuration file, an error is returned if this value is directly assigned to an integer field. Generally, we use transformation functions in hql for processing. The code for copying the code is as follows: entrykeyareasinfoadapterbeanparent?acthibe

The parameters passed through queryMap of valuelist are of the string type by default. In hql of the valuelist configuration file, an error is returned if this value is directly assigned to an integer field. Generally, we use transformation functions in hql for processing. The Code is as follows: entry key = areasInfoAdapter bean parent = abstractHibe

The parameters passed through queryMap of valuelist are of the string type by default. In hql of the valuelist configuration file, an error is returned if this value is directly assigned to an integer field. We generally use transformation functions in hql for processing, as shown below:

The Code is as follows:




19

Id
Desc


From com. berheley. hcms. persistence. model. TBaseAreas as tb
Where tb. status = '1'
/~ HId: and tb. hId = to_number {hId }~ /
/~ OId: and tb. oId = to_number {oId }~ /
Order by tb. code asc


Vo
160000
True


This method is troublesome. function processing must be added to all integer fields, and function incompatibility may occur during database migration. You can use the ValueList configuration to uniformly set integer fields. valuelist will transform the configured parameters before assembling SQL statements. As follows:

The Code is as follows:










,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.