Вопрос

I'm writing a JavaFX Application and am hoping to use Spring Data/JDBC/QueryDSL to aid with persistence. The question I'm having is whether I should expect to have any problems with QueryDSL's generated classes when the source models use JavaFX's observable properties (SimpleDoublePropety etc) rather than Java's regular primitives. I'm having a hard time wrapping my head around all the pieces at play here and how they'll interact, so any insight as to whether JavaFX and QueryDSL (specifically generated sources) play well together is greatly appreciated!

Cheers!

Это было полезно?

Решение

If you plan to use Querydsl SQL there won't be a direct connection between the Querydsl generated classes and your JavaFX models, so there won't be any conflict.

If you plan to create Querydsl types based on annotated JavaFX model classes using APT instead then your JavaBean accessors will be used as the properties.

e.g.

class Bill {

    private DoubleProperty amountDue = new SimpleDoubleProperty();

    // this will be picked up by Querydsl and treated as a property
    public double getAmountDue() { 
        return amountDue.get();
    }

    public void setAmountDue(double value) { 
        amountDue.set(value);
    }

    public DoubleProperty amountDueProperty() {
        return amountDue;
    }

}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top