- public void insert() throws GigiApiException {
- synchronized (Domain.class) {
- if (id != 0) {
- throw new GigiApiException("already inserted.");
- }
- checkInsert(suffix);
- GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO `domains` SET memid=?, domain=?");
- ps.setInt(1, owner.getId());
- ps.setString(2, suffix);
- ps.execute();
- id = ps.lastInsertId();
- myCache.put(this);