org.teamapps.pojo.template.UdbEntity.txt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of universal-db Show documentation
Show all versions of universal-db Show documentation
Ultra fast TeamApps database
package {package};
import org.teamapps.universaldb.*;
import org.teamapps.universaldb.index.*;
import org.teamapps.universaldb.index.numeric.*;
import org.teamapps.universaldb.index.text.*;
import org.teamapps.universaldb.index.translation.*;
import org.teamapps.universaldb.index.bool.*;
import org.teamapps.universaldb.index.file.*;
import org.teamapps.universaldb.index.reference.multi.*;
import org.teamapps.universaldb.index.reference.single.*;
import org.teamapps.universaldb.index.binary.*;
import org.teamapps.universaldb.pojo.*;
import org.teamapps.universaldb.pojo.template.*;
import org.teamapps.universaldb.transaction.*;
import org.teamapps.universaldb.record.*;
import java.util.*;
import java.time.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.function.Supplier;
{imports}
public class {udbType} extends AbstractUdbEntity<{type}> implements {type} {
{staticFields}
private static void setTableIndex(TableIndex tableIndex) {
table = tableIndex;
{staticFieldSetters}
}
public static List<{type}> getAll() {
return new EntityBitSetList<>({type}.getBuilder(), table.getRecordBitSet());
}
public static List<{type}> sort(List<{type}> list, String sortFieldName, boolean ascending, String ... path) {
return sort(table, list, sortFieldName, ascending, path);
}
public static List<{type}> sort(BitSet recordIds, String sortFieldName, boolean ascending, String ... path) {
return sort(table, {type}.getBuilder(), recordIds, sortFieldName, ascending, path);
}
public static int getCount() {
return table.getCount();
}
public {udbType}() {
super(table);
}
public {udbType}(int id, boolean createEntity) {
super(table, id, createEntity);
}
@Override
public {type} build() {
return new {udbType}();
}
@Override
public {type} build(int id) {
return new {udbType}(id, false);
}
{methods}
@Override
public {udbType} save(Transaction transaction, boolean strictChangeVerification) {
save(transaction, table, strictChangeVerification);
return this;
}
@Override
public {udbType} saveTransactional(boolean strictChangeVerification) {
save(UniversalDB.getThreadLocalTransaction(), table, strictChangeVerification);
return this;
}
@Override
public {udbType} save() {
save(table);
return this;
}
@Override
public void delete(Transaction transaction) {
delete(transaction, table);
}
@Override
public void delete() {
delete(table);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy