Skip to content

[BUG] - @Formula not working in included Fetcher #948

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

Closed
storympro opened this issue Mar 10, 2025 · 2 comments
Closed

[BUG] - @Formula not working in included Fetcher #948

storympro opened this issue Mar 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@storympro
Copy link

storympro commented Mar 10, 2025

Jimmer Version

0.9.63

JDK Version

23

Database

postgresql

OS

Windows

Expected behavior

https://babyfish-ct.github.io/jimmer-doc/docs/mapping/advanced/calculated/formula#depending-on-simple-properties

I am waiting JSON output:

{
  "id" : 9,
  "fullName" : "Admin Admin ",
  "email" : "[email protected]"
}

Actual behavior

I receive JSON output:

{
  "id" : 9,
  "firstName" : "Admin",
  "lastName" : "Admin",
  "patronymic" : null,
  "email" : "[email protected]"
}

Description

When executing a select query, I get unexpected behavior.

Reproduction steps

// any fetcher
 .user(ReferenceFetchType.JOIN_ALWAYS, UserFetcher.$
                        .fullName()
                        .email())

Generated SQL

No response

Relation Model

@Entity
public interface User extends UserFLP {

    String email();

    @Formula(dependencies = {"firstName", "lastName", "patronymic"})
    default String fullName() {
        return firstName() + ' ' + lastName() + ' ' + patronymic();
    }
@MappedSuperclass
public interface UserFLP {

    String firstName();

    String lastName();

    @Nullable
    String patronymic();
}

Screenshots

No response

Logs

No response

@storympro storympro added the bug Something isn't working label Mar 10, 2025
babyfish-ct added a commit that referenced this issue Mar 10, 2025
@babyfish-ct
Copy link
Owner

Try 0.9.64

@storympro
Copy link
Author

Try 0.9.64

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants