Skip to content

Request for adding explanation how to call static methods to MyBatis manual. #871

Open
@Nobuyuki-Inaba

Description

@Nobuyuki-Inaba

Hi,

I know that you are able to call static methods in My Batis Mapper XML files, but the manual, I think, doesn't explain the way directly. I'm afraid that some of my colleagues had troubled because they don't know that way.
Surely, the "Dynamic SQL" page explains like this.

MyBatis employs powerful OGNL based expressions to eliminate most of the other elements

, so it's make sense that you can call static methods using OGNL syntax, but its' not straightforward explanation.

I would like to suggest to add the below explanation to "Mapper XML Files" page. If you'd add the explanation to the page, it would be great.


You can call static methods and refer static fields like this,
calling a static method; @Class@method(args), e.g.

@org.apache.commons.lang3.StringUtils@isEmpty(data)

refering a static field: @Class@field, e.g.

@java.lang.Math@PI

Best regards,
Nobuyuki Inaba

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationIndicates a changing on documentation(reference or javadoc)enhancementImprove a feature or add a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions