Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add String functions(concat) #545

Merged
merged 7 commits into from
Dec 1, 2023

Conversation

waahhh
Copy link
Contributor

@waahhh waahhh commented Nov 29, 2023

Motivation

  • Support for String functions(concat)

Modifications

  • Add JpqlConcat, JpqlConcatSerializer, dsl for concat function with tests

Commit Convention Rule

Commit type Description
feat New Feature
fix Fix bug
docs Documentation only changed
ci Change CI configuration
refactor Not a bug fix or add feature, just refactoring code
test Add Test case or fix wrong test case
style Only change the code style(ex. white-space, formatting)
chore It refers to minor tasks such as library version upgrade, typo correction, etc.
  • If you want to add some more commit type please describe it on the Pull Request

Result

  • Please describe the result after this PR is merged.

Closes

  • #{issue number} (If this PR resolves an issue.)

Comment on lines 1098 to 1100
value1: String,
value2: String,
vararg others: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The String parameter should probably be nullable. When I tested it, both eclipselink and hibernate returned a blank character if null was passed in.

Users can take advantage of this functionality, so I don't think we should prevent it.


String 파라미터는 nullable이여야 할 것 같아요. 테스트 해보니 eclipselink 및 hibernate 모두 null이면 공백 문자를 반환해주었습니다.

사용자가 이 기능을 활용할 수 있기 때문에 저희가 막으면 안 될 것 같아요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String 파라미터는 nullable이여야 할 것 같아요. 테스트 해보니 eclipselink 및 hibernate 모두 null이면 공백 문자를 반환해주었습니다.

사용자가 이 기능을 활용할 수 있기 때문에 저희가 막으면 안 될 것 같아요.

그럼 말씀하신 케이스 고려해서 아래처럼 default value는 없이 변경하겠습니다.

    fun concat(
        value1: String?,
        value2: String?,
        vararg others: String?,
    ): Expression<String> {
        return Expressions.concat(
            Expressions.value(value1),
            Expressions.value(value2),
            others.map { Expressions.value(it) },
        )
    }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! 감사합니다. ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shouwn
리뷰 반영했습니다!

@waahhh waahhh force-pushed the feature/add-string-functions-concat branch from 8b5f402 to bb6c025 Compare December 1, 2023 10:06
@shouwn shouwn merged commit e204a53 into line:develop Dec 1, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants