/** * Adds the table to select from. * * @param table the table to select from. * @return a newly built SELECT statement that selects from {@code table}. */ public Select from(TableMetadata table) { return new Select(table, columnNames, isDistinct, isJson); } }
return new Select() .from(Student.class) .innerJoin(StudentCourse.class).on("students.id = studentcourses.id") .where("studentcourses.course = ?", courseId) .execute();
/** * Adds the table to select from. * * @param keyspace the name of the keyspace to select from. * @param table the name of the table to select from. * @return a newly built SELECT statement that selects from {@code keyspace.table}. */ public Select from(String keyspace, String table) { return new Select(keyspace, table, columnNames, isDistinct, isJson); }
public static List<Record> search(String searchTerm) { return new Select().from(Record.class) .where("Data LIKE ?", new String[]{'%' + searchTerm + '%'}) .orderBy("Name ASC") .execute(); }
public static List<User> getUsersByName (String username) { return new Select () .from ( User.class ) .where ( "username = ?", username) .execute(); }
User user = new Select().from(User.class).where("userId = ?", userIdYouWantToRetrieve).executeSingle(); if (user != null){ user.setVerified(true); } else { user = new User(){//populate your new user here from json } } user.save();
if (entity == null) { TableInfo tableInfo = Cache.getTableInfo(entityType); entity = new Select().from(entityType) .where(tableInfo.getIdName() + "=?", entityId).executeSingle(); }
new Select("SUM(Logs.Price)") .from(Logs.class) .join(Receipt.class) .on("Receipt.Id = Logs.Receipt") .groupBy("Logs.sortID") .execute();
public static List<Items> getAll() { return new Select().from(Items.class).execute(); } ... mItems = Items.getAll() for(Items item : mItems) { item.delete(); }
List<Question> questions = new Select() .distinct() .from(Question.class) .groupBy("ZCLASSLEVEL") .execute();
public abstract class BaseComponentType { public static <T extends BaseComponentType> T findByUid(Class<T> klass, String uid) { return new Select().from( klass ).where( "uid = ?", uid ).executeSingle(); } }
/** * Adds the table to select from. * * @param keyspace the name of the keyspace to select from. * @param table the name of the table to select from. * @return a newly built SELECT statement that selects from {@code keyspace.table}. */ public Select from(String keyspace, String table) { return new Select(keyspace, table, columnNames, isDistinct, isJson); }
/** * Adds the table to select from. * * @param table the table to select from. * @return a newly built SELECT statement that selects from {@code table}. */ public Select from(TableMetadata table) { return new Select(table, columnNames, isDistinct, isJson); } }
var mySelect = new Select({ id: 'mystatus', name: 'mystatus', style: {width: '150px'}, required : false, store: os, searchAttr: 'label', }, "mystatus");
return new Select() .all() .from(Item.class) .execute();
List<Chats> s = new Select() .from(Chats.class) .where(col_conversation + " = ?",conversation.getId()) .where(col_sender + " = ?", sender.getId()) .where(body + " = ?", body) .execute();
public static List<Program> getByIds(Collection<Integer> ids) { return new Select().from(Program.class) .where("programId in " + DAOUtil.makePlaceholders(ids.size()), ids.toArray(new Integer[ids.size()])) .execute(); }
List<String> ids = new ArrayList<String>(); Condition.In in = Condition.column(Tree$Table.ID).in(ids.get(0)); for (i = 1; i < ids.size(); i++){ in.and(ids.get(i)); } long count = new Select().count().from(Tree.class) .where(in) .count();
HashMap<String, String> users = new HashMap<String, String>(); users.put("1", "John"); users.put("2", "Bob"); users.put("3", "Tom"); Select select = new Select(); for(Iterator<String> i = users.keySet().iterator(); i.hasNext();) { String key = i.next(); select.addItem(key); select.setItemCaption(key, users.get(key)); } String selValue = (String) select.getValue();
SelectOptions<Produce> fruitOptions = new SelectOptions<Produce>( "fruits", fruitCollection, new FruitRenderer()); SelectOptions<Produce> vegetableOptions = new SelectOptions<Produce>( "vegetables", vegetableCollection, new VegetableRenderer()); Select select = new Select("produceSelect", new PropertyModel<Produce>(model, "favProduce")); select.add(fruitOptions); select.add(vegetableOptions);