Merge branch 'master' into DurationFieldInFightEndsPacket
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Commit
9df7ed39a4
@ -32,6 +32,10 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class Event {
|
||||
|
||||
static {
|
||||
SchematicType.Normal.name(); // Ensure SchematicType is loaded.
|
||||
}
|
||||
|
||||
private static final Table<Event> table = new Table<>(Event.class);
|
||||
|
||||
private static final SelectStatement<Event> byCurrent = new SelectStatement<>(table, "SELECT * FROM Event WHERE Start < now() AND End > now()");
|
||||
|
@ -26,7 +26,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.Timestamp;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
|
||||
@AllArgsConstructor
|
||||
|
@ -20,9 +20,7 @@
|
||||
package de.steamwar.sql;
|
||||
|
||||
import de.steamwar.sql.internal.*;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
@ -32,6 +30,7 @@ import java.util.function.Predicate;
|
||||
public class SchematicNode {
|
||||
|
||||
static {
|
||||
SchematicType.Normal.name(); // Ensure SchematicType is loaded.
|
||||
new SqlTypeMapper<>(SchematicNode.class, null, (rs, identifier) -> { throw new SecurityException("SchematicNode cannot be used as type (recursive select)"); }, (st, index, value) -> st.setInt(index, value.nodeId));
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,12 @@ public final class SqlTypeMapper<T> {
|
||||
private static final Map<Class<?>, SqlTypeMapper<?>> mappers = new IdentityHashMap<>();
|
||||
|
||||
public static <T> SqlTypeMapper<T> getMapper(Class<?> clazz) {
|
||||
return (SqlTypeMapper<T>) mappers.get(clazz);
|
||||
SqlTypeMapper<T> result = (SqlTypeMapper<T>) mappers.get(clazz);
|
||||
|
||||
if(result == null)
|
||||
throw new SecurityException("Unregistered mapper requested: " + clazz.getName());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T extends Enum<T>> void ordinalEnumMapper(Class<T> type) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren