PandaLib/src/fr/pandacube/java/util/db2/SQLContact.java
Marc Baloup b2a19e09c1 Mise à jour ORM + Utilisation plus simple des logs
- toute la base de données fonctionne en utf8mb4
- Le PlayerFinder gère l'historique des pseudos
- Fin de l'utilisation de l'ancien ORM
2016-12-28 05:08:00 +01:00

45 lines
1.6 KiB
Java

package fr.pandacube.java.util.db2;
import java.util.UUID;
import fr.pandacube.java.util.db2.sql_tools.SQLElement;
import fr.pandacube.java.util.db2.sql_tools.SQLField;
import fr.pandacube.java.util.db2.sql_tools.SQLFKField;
import fr.pandacube.java.util.db2.sql_tools.SQLType;
public class SQLContact extends SQLElement {
public SQLContact() { super(); }
public SQLContact(int id) { super(id); }
@Override
protected String tableName() { return "pandacube_contact"; }
public static final SQLField<Integer> time = new SQLField<>( "time", SQLType.INT, false);
public static final SQLFKField<String, SQLPlayer> playerId = new SQLFKField<>("playerId", SQLType.CHAR(36), true, SQLPlayer.class, SQLPlayer.playerId);
public static final SQLField<String> userName = new SQLField<>( "userName", SQLType.VARCHAR(50), true);
public static final SQLField<String> userMail = new SQLField<>( "userMail", SQLType.VARCHAR(50), true);
public static final SQLField<String> titre = new SQLField<>( "titre", SQLType.VARCHAR(100), false);
public static final SQLField<String> texte = new SQLField<>( "texte", SQLType.TEXT, false);
public static final SQLField<Boolean> hidden = new SQLField<>( "hidden", SQLType.BOOLEAN, false, (Boolean)false);
public UUID getPlayerId() {
String id = (String)get(playerId);
return (id == null) ? null : UUID.fromString(id);
}
public void setPlayerId(UUID pName) {
set(playerId, (pName == null) ? (String)null : pName.toString());
}
}