Package com.liferay.portal.kernel.dao.orm

Examples of com.liferay.portal.kernel.dao.orm.Session.createSQLQuery()


    try {
      session = openSession();

      String sql = CustomSQLUtil.get(COUNT_BY_G1_G2_U1_U2);

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME, Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);
View Full Code Here


    try {
      session = openSession();

      String sql = CustomSQLUtil.get(FIND_BY_G1_G2_U1_U2);

      SQLQuery q = session.createSQLQuery(sql);

      q.addEntity("SN_WallEntry", WallEntryImpl.class);

      QueryPos qPos = QueryPos.getInstance(q);
View Full Code Here

    public void executeUpdate(DBConnection dbConnection, String sql, List params, Map<String, Object> options) throws DBException {
        Session session = (Session) dbConnection.getNativeConnection();
        SQLQuery query = null;

        try {
            query = session.createSQLQuery(sql);
            QueryPos qpos = QueryPos.getInstance(query);
            for (Object item: params) {
                qpos.add(item);
            }
            log.debug(sql + "\n" + params);
View Full Code Here

        List items = new ArrayList();
        Session session = (Session) dbConnection.getNativeConnection();
        SQLQuery query = null;

        try {
            query = session.createSQLQuery(sql);
            QueryPos qpos = QueryPos.getInstance(query);
            for (Object item: params) {
                qpos.add(item);
            }
            log.debug(sql + "\n" + params);
View Full Code Here

        try {
            session = openSession();
            String qString = "SELECT Transaction.id, Book.id, Book.title, max(Transaction.id) AS max_Transaction__id FROM Transaction  RIGHT JOIN Book  ON Book.id = Transaction.bookId  GROUP BY Book.title";
//            String qString = "SELECT Transaction.id, Book.id, Book.title FROM Transaction  RIGHT JOIN Book  ON Book.id = Transaction.bookId";
            SQLQuery query = session.createSQLQuery(qString, true);
            query.addScalar("Book.id", Type.LONG);
            query.addScalar("Transaction.id", Type.LONG);
            query.addScalar("Book.title", Type.STRING);
            query.addScalar("max_Transaction__id", Type.LONG);
            System.out.println(qString);
View Full Code Here

    try {
      session = openSession();

      String sql = CustomSQLUtil.get(FIND_BY_EVENTNAME_EVENTDESCRIPTON_LOCATIONNAME);

      SQLQuery q = session.createSQLQuery(sql);
      q.setCacheable(false);
      q.addEntity("Event_Event", EventImpl.class);

      QueryPos qPos = QueryPos.getInstance(q);
      qPos.add(eventName);
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      if (getDB().isSupportsInlineDistinct()) {
        q.addEntity(_FILTER_ENTITY_ALIAS, EventImpl.class);
      }
      else {
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME,
        com.liferay.portal.kernel.dao.orm.Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      if (getDB().isSupportsInlineDistinct()) {
        q.addEntity(_FILTER_ENTITY_ALIAS, LocationImpl.class);
      }
      else {
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME,
        com.liferay.portal.kernel.dao.orm.Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);
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.