Package org.hibernate

Examples of org.hibernate.Query.list()


  /**
   * Ǩ���ռǷ���
   */
  protected static void upgradeCatalogs(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM CatalogForm c ORDER BY c.id ASC");
    List catalogs = q.list();
   
    for(int i=0;i<catalogs.size();i++){
      CatalogForm cform = (CatalogForm)catalogs.get(i);
      CatalogBean cbean = new CatalogBean();
      cbean.setSite(site);
View Full Code Here


  /**
   * Ǩ���ռ�
   */
  protected static void upgradeLogs(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM LogForm c ORDER BY c.id ASC");
    List logs = q.list();
   
    for(int i=0;i<logs.size();i++){
      LogForm log = (LogForm)logs.get(i);
      DiaryBean dbean = new DiaryBean();
      dbean.setCatalog((CatalogBean)catalogids.get(new Integer(log.getCategory())));
View Full Code Here

  /**
   * Ǩ������
   */
  protected static void upgradeReplies(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM ReplyForm c ORDER BY c.id ASC");
    List replies = q.list();
   
    for(int i=0;i<replies.size();i++){
      ReplyForm rform = (ReplyForm)replies.get(i);
      DiaryReplyBean rbean = new DiaryReplyBean();
      rbean.getClient().setAddr("127.0.0.1");
View Full Code Here

  /**
   * �û�Ǩ��
   */
  protected static void upgradeUsers(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM UserForm u ORDER BY u.id ASC");
    List users = q.list();
   
    for(int i=0;i<users.size();i++){
      UserForm user = (UserForm)users.get(i)
      UserBean ubean = new UserBean();
      //���뵽ָ����site
View Full Code Here

  /**
   * ��������Ǩ��
   */
  protected static void upgradeLinks(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM LinkForm l ORDER BY l.id ASC");
    List links = q.list();   
    for(int i=0;i<links.size();i++){
      LinkForm link = (LinkForm)links.get(i)
      LinkBean lbean = new LinkBean();
      lbean.setCreateTime(link.getCreateTime());
      lbean.setSiteId(site.getId());
View Full Code Here

   * @param old_ssn
   * @param new_ssn
   */
  protected static void upgradeMessages(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM MessageForm l ORDER BY l.id ASC");
    List msgs = q.list();   
    for(int i=0;i<msgs.size();i++){
      MessageForm msg = (MessageForm)msgs.get(i)
      MessageBean mbean = new MessageBean();
      mbean.setContent(msg.getContent());
      mbean.setReadTime(msg.getReadTime());
View Full Code Here

   * @param old_ssn
   * @param new_ssn
   */
  protected static void upgradeBookmarks(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM BookMarkBean l ORDER BY l.id ASC");
    List bmbs = q.list();   
    for(int i=0;i<bmbs.size();i++){
      BookMarkBean bm = (BookMarkBean)bmbs.get(i)
      BookmarkBean mbean = new BookmarkBean();
      mbean.setCreateTime(bm.getCreateTime());
      mbean.setOwner((UserBean)userids.get(new Integer(bm.getUserId())));
View Full Code Here

    Query query = getQuery();
    QueryParameters queryPara = new QueryParameters(parameters, method.getParameterAnnotations());
    fittingQuery(query, queryPara);
    Find find = getAnnotation();
    if (!find.resultClass().equals(void.class))
      return toProjectionalList(find.resultClass(), query.list());
    return query.list();
  }

  @SuppressWarnings("unchecked")
  protected List toProjectionalList(Class<?> clz, List<Object[]> records) {
View Full Code Here

    QueryParameters queryPara = new QueryParameters(parameters, method.getParameterAnnotations());
    fittingQuery(query, queryPara);
    Find find = getAnnotation();
    if (!find.resultClass().equals(void.class))
      return toProjectionalList(find.resultClass(), query.list());
    return query.list();
  }

  @SuppressWarnings("unchecked")
  protected List toProjectionalList(Class<?> clz, List<Object[]> records) {
    List result = new ArrayList();
View Full Code Here

  public List<E> list(final String qname,
      final Map<String, Object> parameters) {
    final Query query = this.createQuery(this.getFullQueryName(qname,
        BaseEntityManager.FIND_SUFFIX));
    this.fittingQuery(query, parameters);
    return query.list();
  }

  /*
   * (non-Javadoc)
   *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.