Skip to content

Commit

Permalink
Last few fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jan 1, 2024
1 parent f4c5da0 commit a275738
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>de.ree6</groupId>
<artifactId>Ree6-SQL</artifactId>
<description>This is the SQL-Module for Ree6!</description>
<version>2.2.1</version>
<version>2.2.2</version>

<properties>
<sonar.organization>ree6-applications</sonar.organization>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/de/presti/ree6/sql/SQLWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ public boolean isVoiceLevelRewardSetup(long guildId, long roleId, long level) {
* @return {@link List<String>} as List with {@link Invite}.
*/
public List<Invite> getInvites(long guildId) {
return getEntityList(new Invite(), "FROM Invite WHERE guildAndId.guildId=:gid", Map.of("gid", guildId));
return getEntityList(new Invite(), "FROM Invite WHERE guildAndCode.guildId=:gid", Map.of("gid", guildId));
}

/**
Expand All @@ -1558,7 +1558,7 @@ public List<Invite> getInvites(long guildId) {
* @return {@link Boolean} as Result if true, then it's saved in our Database | if false, we couldn't find anything.
*/
public boolean existsInvite(long guildId, String inviteCreator, String inviteCode) {
return getEntity(new Invite(), "FROM Invite WHERE guildAndId.guildId=:gid AND userId=:uid AND code=:code", Map.of("gid", guildId, "uid", inviteCreator, "code", inviteCode)) != null;
return getEntity(new Invite(), "FROM Invite WHERE guildAndCode.guildId=:gid AND userId=:uid AND guildAndCode.code=:code", Map.of("gid", guildId, "uid", inviteCreator, "code", inviteCode)) != null;
}

/**
Expand Down Expand Up @@ -1591,7 +1591,7 @@ public void setInvite(long guildId, long inviteCreator, String inviteCode, long
* @return {@link Invite} as result if true, then it's saved in our Database | may be null.
*/
public Invite getInvite(long guildId, String inviteCode) {
return getEntity(new Invite(), "FROM Invite WHERE guildAndId.guildId=:gid AND code=:code", Map.of("gid", guildId, "code", inviteCode));
return getEntity(new Invite(), "FROM Invite WHERE guildAndCode.guildId=:gid AND guildAndCode.code=:code", Map.of("gid", guildId, "code", inviteCode));
}

/**
Expand All @@ -1603,7 +1603,7 @@ public Invite getInvite(long guildId, String inviteCode) {
* @return {@link Invite} as result if true, then it's saved in our Database | may be null.
*/
public Invite getInvite(long guildId, long inviteCreator, String inviteCode) {
return getEntity(new Invite(), "FROM Invite WHERE guildAndId.guildId=:gid AND userId=:uid AND code=:code", Map.of("gid", guildId, "uid", inviteCreator, "code", inviteCode));
return getEntity(new Invite(), "FROM Invite WHERE guildAndCode.guildId=:gid AND userId=:uid AND guildAndCode.code=:code", Map.of("gid", guildId, "uid", inviteCreator, "code", inviteCode));
}

/**
Expand All @@ -1616,7 +1616,7 @@ public Invite getInvite(long guildId, long inviteCreator, String inviteCode) {
* @return {@link Invite} as result if true, then it's saved in our Database | may be null.
*/
public Invite getInvite(long guildId, long inviteCreator, String inviteCode, long inviteUsage) {
return getEntity(new Invite(), "FROM Invite WHERE guildAndId.guildId=:gid AND userId=:uid AND code=:code AND USES=:uses",
return getEntity(new Invite(), "FROM Invite WHERE guildAndCode.guildId=:gid AND userId=:uid AND guildAndCode.code=:code AND USES=:uses",
Map.of("gid", guildId, "uid", inviteCreator, "code", inviteCode, "uses", inviteUsage));
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public static void main(String[] args) throws SQLException {
}

SQLSession.getSqlConnector().getSqlWorker().getEntityList(new de.presti.ree6.sql.entities.Warning(), "", null);
SQLSession.getSqlConnector().getSqlWorker().getEntityList(new de.presti.ree6.sql.entities.Giveaway(), "", null);
SQLSession.getSqlConnector().getSqlWorker().getEntityList(new de.presti.ree6.sql.entities.roles.AutoRole(), "", null);
}

}

0 comments on commit a275738

Please sign in to comment.