Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    kriegster108
    @kriegster108
    used defaults @julgus
    Dependency 'com.speedment.enterprise.connectors:oracle-connector:3.2.6' not found
    Dependency 'com.speedment.enterprise.hazelcast:hazelcast-runtime:3.2.6' not found
    kriegster108
    @kriegster108
    Weird, I see it in the repo itself, not sure why maven doesnt see it
    kriegster108
    @kriegster108
    when I plug in 3.1.12, it seems to not complain
    as the version # for these depdencies
    Julia Gustafsson
    @julgus
    Still confused as to why this might be. On my end both dependencies are found without any issues using v. 3.2.6. Could your try using the latest released version - 3.2.10?
    ANKUR PRAMANIK
    @ankurpramanik
    I am new to Speedment, I just created a spring boot application and using speedment:tool I connected to database. My application is working. Now in real world there are different database name in same structure like (development database name as student_dev, Production database name like student_prod) So How can I connect different database after deploying the application as war in tomcat?
    And another problem I am facing with MS SQL server that, speedment tool window is not opening
    Per-Åke Minborg
    @minborg
    In the speedment builder, you can set the dbms name. You can easilly pickup the name using system properties in your app.
    Mark Schrijver
    @ractoc
    I'm currently working on a search page,. which presents me qith some issues on how best to build that in Speedment, as the entire where clause is dynamic
    I have a fleet table, and a registration table.
    the fleet has a start date
    now, when a start date has been provided, I need to filter on this start date. If no start date has been provided, I don't need this filter
    if the boolean registered is set to true, I need to link in the second table to check of the user has registered. If the boolean is set to false, this doesn't need to happen
    in all cases, I only need to return a list of Fleet object
    CUrrently, I have a few of the search params in there
    but I'm not sure I'm doing it right, and I'm not sure how to dynamically link in that second table
    This is what I have now:
    fleetManager.stream()
    .filter(fleet -> params.getStart() == null ||
    !fleet.getStartDateTime().isPresent() ||
    fleet.getStartDateTime()
    .get()
    .toInstant()
    .isAfter(params.getStart().toInstant(ZoneOffset.UTC)))
    .filter(fleet -> params.getEnd() == null ||
    !fleet.getStartDateTime().isPresent() ||
    fleet.getStartDateTime()
    .get()
    .toInstant()
    .isBefore(params.getEnd().toInstant(ZoneOffset.UTC)))
    .filter(fleet -> params.isOwned() && fleet.getOwner() == charId)
    .filter(fleet -> ArrayUtils.isNotEmpty(params.getTypes()) &&
    Arrays.stream(params.getTypes())
    .anyMatch(type -> fleet.getTypeId() == type.getId()));
    Here, params.getStart() is an optional start date, params.getEnd() is an optional end date, params.isOwner() is a boolean and params.getTypes() is an optional array.
    if the param is set, it needs to be filtered, if it is not present, no filter is needed
    for the second table, I can easily setup a filter which opens a second stream to the other table and then to a matchAny, but I'm not sure that's the best way to go abou ti
    Per-Åke Minborg
    @minborg
    Is the code available in a pblic repository where it might be easier for me to have a look at it?
    starting at line 45I put all the filters inside IF statements, so the filters onlly get added whenrequired
    this works great for simple filters on the main table
    I'm just not sure what thebestway would be to link in those other two tables
    I'm currently reusing the service method I already have in place, starting from line 59
    but that means those methods getRegistration and getInvitation get called once per record found
    which might not work so well when the table gets bigger
    Per-Åke Minborg
    @minborg

    Hi Mark. This is the classical N+1 select problem.

    As you point out, the solution does not scale that well. Why not create a join and add in the simple predicates as the table, respectively (e.g. START_DATE_TIME)?

    Mark Schrijver
    @ractoc
    so effectively I would then be creating a select statemet joining three tables, but restricting the actual selected fields to the one table I need....
    and with the distinct keyword, I could then exclude any duplicates?
    hhmm..
    I might need to figure out the actual SQL for that first, before converting it to speedment stream based
    Per-Åke Minborg
    @minborg
    Hi @nist42 . So it worked with the Speedment Application Builder? Not sure I understand the case where it did not work. Could you please elaborate a bit?
    Mark Schrijver
    @ractoc
    finally came around to try and figure out how to join those two tables
    but I'm running into a problem.
    I set it all up with Speedment:
    fleetJoin
    .where(OWNER.equal(charId)
    .or(Fleet.RESTRICTED.equal(false)))
    .leftJoinOn(Invite.FLEET_ID).equal(Fleet.ID)
    .where((Invite.TYPE.equal("character").and(Invite.INVITEE_ID.equal(charId)))
    .or(Invite.TYPE.equal("corporation").and(Invite.INVITEE_ID.equal(corpId)))
    .or(Invite.TYPE.isNull()))
    .build()
    .stream()
    .count()
    this results in a rowcount of 0
    when I run the corresponding query against the same database directly, with the same parameters I get from the speedmet logs, I get 2 resulting rows:
    2021-02-16T22:47:13.556Z DEBUG [http-nio-8282-exec-1] (#STREAM) - SELECT A.id,A.name,A.owner,A.start,A.duration,A.start_date_time,A.type_id,A.restricted,A.description, B.id,B.fleet_id,B.type,B.key,B.invitee_id FROM eve_fleetmanager.fleet AS A LEFT JOIN eve_fleetmanager.invite AS B ON (B.fleet_id = A.id) WHERE ((A.owner = ?) OR (A.restricted = ? COLLATE utf8_bin)) AND (((B.type = ? COLLATE utf8_bin) AND (B.invitee_id = ?)) OR ((B.type = ? COLLATE utf8_bin) AND (B.invitee_id = ?)) OR (B.type IS NULL)) [Integer 2115635889, String false, String character, Integer 2115635889, String corporation, Integer 98628638]
    could a cause of this be that my B result is empty for both rows returned?
    the debgger says I'm getting a Tule20OfNullables out of the build method
    Mark Schrijver
    @ractoc
    missed a bit of the Java code...
    Long rowCount = joinComponent.from(FleetManager.IDENTIFIER)
    .where(OWNER.equal(charId)
    .or(Fleet.RESTRICTED.equal(false)))
    .rightJoinOn(Invite.FLEET_ID).equal(Fleet.ID)
    .where((Invite.TYPE.equal("character").and(Invite.INVITEE_ID.equal(charId)))
    .or(Invite.TYPE.equal("corporation").and(Invite.INVITEE_ID.equal(corpId)))
    .or(Invite.TYPE.isNull()))
    .build()
    .stream()
    .count();
    so the query is good, I tested that in mysql directly
    but the speedment code is giving me 0 rows returned