Hey all,
I'm not a very experienced Java programmer, even more so SQL. I just
discovered jOOQ yesterday and I've already taken a liking to it. But I've
come across a couple of issues I can't figure out.
I'm looking to implement multi-user logins but I don't really know how to
go about doing it with jOOQ. Would I need to pass the username/password
entered over to the xml configuration file?
The other thing I'm having trouble with is using left joins in jOOQ. I've
read that section in the manual but for some reason I can't get it to work.
Here's what I've got so far. The program keeps track of game matches for an
upcoming local gaming tournament. The specific functionality I'm working on
at the minute basically polls the database for all match info from a
specific team and displays everything into a single table..
create.select(Matches.MATCHES.MATCH_ID, Teams.TEAM.TEAM_NAME,
> Match.MATCHES.MAP,
> //Get Registered Matches
> DSL.concat(String.valueOf(DSL.select(MatchLog.MATCH_LOG.GAME)
> .where(MatchLog.MATCH_LOG.NEW_STATUS.equal("Registered")
>
> .and(MatchLog.MATCH_LOG.MATCH_ID.equal(Matches.MATCHES.MATCH_ID)))
>
> .orderBy(MatchLog.MATCH_LOG.GAME).limit(1))).as("match_registered"),
> //Get any Started Matches
> DSL.concat(String.valueOf(DSL.select(MatchLog.MATCH_LOG.GAME)
> .where(MatchLog.MATCH_LOG.NEW_STATUS.equal("Started")
>
> .and(MatchLog.MATCH_LOG.MATCH_ID.equal(Matches.MATCHES.MATCH_ID)))
>
> .orderBy(MatchLog.MATCH_LOG.GAME).limit(1))).as("match_started"),
> //Get finished Matches
> DSL.concat(String.valueOf(DSL.select(MatchLog.MATCH_LOG.GAME)
> .where(MatchLog.MATCH_LOG.NEW_STATUS.equal("Match Ended")
>
> .and(SMatchLog.MATCH_LOG.MATCH_ID.equal(Matches.MATCHES.MATCH_ID)))
>
> .orderBy(MatchLog.MATCH_LOG.GAME).limit(1))).as("match_finished"),
> //Obtain disputed Matches
> DSL.concat(String.valueOf(DSL.select(MatchLog.MATCH_LOG.GAME)
> .where(MatchLog.MATCH_LOG.NEW_STATUS.equal("Report")
>
> .and(MatchLog.MATCH_LOG.MATCH_ID.equal(Matches.MATCHES.MATCH_ID)))
>
> .orderBy(MatchLog.MATCH_LOG.GAME).limit(1))).as("match_disputed")
);
At the end of this, I want to put in these statements:
"LEFT JOIN gamematches.team ON
> gamematches.matches.team_id=gamematches.team.team_id\n"
and...
> "LEFT JOIN gamematches.players ON
> gamematches.matches.player_id=gamematches.players.player_id\n"
and finally...
> "WHERE matches.team_id=?"
But for some reason the .join() method just isn't showing up? Unless I need
to place it somewhere else within the statement?
Also, am I right in thinking that "DESC LIMIT 1" is the same as ".limit(1)"?
Any help is greatly appreciated!
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.