Вопрос по java, mysql – Как выбрать столбец с помощью Hibernate?

35

Error: User Rate Limit Exceeded

 List<String> firstname = null;

 firstname = getSession().createCriteria(People.class).list();

Error: User Rate Limit Exceeded

Ваш Ответ

3   ответа
2

Error: User Rate Limit Exceeded

  ProjectionList prjection = Projections.projectionList();
if(abc){
    prjection.add(Projections.property("firstname"));
}
else if(xyz){
    prjection.add(Projections.property("lastname"));
}

    ........

    criteria.setProjection(prjection);
7

Error: User Rate Limit Exceeded

....
crit.setProjection(Projections.property("firstname"));
crit.setProjection(Projections.property("lastname"));

List result = crit.list();

...

for (Iterator it = result.iterator(); it.hasNext(); ) {
    Object[] myResult = (Object[]) it.next();
    String firstname = (String) myResult[0];
    String lastname = (String) myResult[1];

    ....
}
43

Error: User Rate Limit Exceeded

.setProjection(Projections.property("firstname"))

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Похожие вопросы