Coder Social home page Coder Social logo

Comments (6)

jwgmeligmeyling avatar jwgmeligmeyling commented on July 18, 2024

Can you try .leftJoin(companyInvoiceDataPublisher, companyInvoiceDataPublisher)?

This explicitly binds the join to the alias companyInvoiceDataPublisher which hopefully triggers the criteria renderer to reuse the alias from the outer query.

from blaze-persistence.

Mukit09 avatar Mukit09 commented on July 18, 2024

@jwgmeligmeyling, No luck! Still generating same query:

select p1_0.id,p1_0.account_number,p1_0.bic,p1_0.city,p1_0.company_name,p1_0.country,p1_0.currency_id,p1_0.deleted_at,p1_0.iban,p1_0.invoice_type,
       p1_0.netsuite_vendor_id,p1_0.postal_code,p1_0.street,p1_0.term,p1_0.vat_number
from publisher_invoice_data p1_0 left join company_invoice_data_publisher c1_0 on (p1_0.id=c1_0.invoice_id)
where p1_0.id in
      ((select * from ((select p3_0.id from publisher_invoice_data p3_0 left join company_invoice_data_publisher c2_0 on (p3_0.id=c2_0.invoice_id)
            where p3_0.deleted_at is null and c2_0.publisher_id in
                (select p6_0.id from publisher p6_0 where p6_0.name like ? escape '!' or cast(p6_0.id as char) like ? escape '!')
            group by p3_0.id order by p3_0.id desc limit 10)) tmp
    )) 
order by p1_0.id desc

I changed to:

PagedList<PublisherInvoicing> publisherInvoicingPagedList = new BlazeJPAQueryFactory(entityManager, criteriaBuilderFactory)
            .selectFrom(publisherInvoicing)
            .leftJoin(companyInvoiceDataPublisher, companyInvoiceDataPublisher)
            .on(publisherInvoicing.id.eq(companyInvoiceDataPublisher.companyInvoiceDataPublisherPk.publisherInvoicing.id))
            .where(booleanBuilder)
            .orderBy(orderBySpecifier)
            .fetchPage((int) pageRequest.getOffset(), pageRequest.getPageSize());

from blaze-persistence.

Mukit09 avatar Mukit09 commented on July 18, 2024

Hello @beikov ! Any suggestion, please?

from blaze-persistence.

Mukit09 avatar Mukit09 commented on July 18, 2024

I added this in the root comment:

And blaze-persistence configuration is:

@Bean
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Lazy(false)
public CriteriaBuilderFactory createAdminCriteriaBuilderFactory() {
    CriteriaBuilderConfiguration config = Criteria.getDefault();
    config.setProperty("com.blazebit.persistence.inline_count_query", "false");

    return config.createCriteriaBuilderFactory(adminEntityManagerFactory);
}

from blaze-persistence.

Mukit09 avatar Mukit09 commented on July 18, 2024

No solution yet!

from blaze-persistence.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 18, 2024

The other join is added through an implicit join. I'm not sure where the implicit join is generated, but it appears to be from blaze-persitence-core and not the Querydsl integration.

You can still try:

.leftJoin(association). defaultJoin()

To force a default join being rendered so that hopefully Blaze-Persistence pick the alias up in the subquery.

If that doesn't fix it we'll need a reproducer (my guess would be that this is reproducible with just core and not the querydsl integration).

from blaze-persistence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.