Package com.dotmarketing.business.query

Examples of com.dotmarketing.business.query.SQLQueryFactory


    @Test
    public void DBSearch () throws DotDataException {

        //Build the query
        String sql = "SELECT * FROM structure ORDER BY inode";
        SQLQueryFactory sqlQueryFactory = new SQLQueryFactory( sql );
        GenericQueryFactory.Query query = sqlQueryFactory.getQuery();

        //Make the search
        List<Map<String, Serializable>> resultList = StructureFactory.DBSearch( query, user, false );

        //Validations
View Full Code Here


    if(systemHost != null){
      return systemHost;
    }

    try {
      SQLQueryFactory factory = new SQLQueryFactory("SELECT * FROM Host WHERE isSystemHost = 1");
      List<Map<String, Serializable>> hosts = factory.execute();
      if(hosts.size() == 0) {
        createSystemHost();
      } else {
        systemHost = new Host(conFac.find((String)hosts.get(0).get("inode")));
      }
View Full Code Here


  private synchronized Host createSystemHost() throws DotDataException,
  DotSecurityException {

    SQLQueryFactory factory = new SQLQueryFactory("SELECT * FROM Host WHERE isSystemHost = 1");
    List<Map<String, Serializable>> hosts = factory.execute();
    User systemUser = APILocator.getUserAPI().getSystemUser();
    if(hosts.size() == 0) {
      Host systemHost = new Host();
      systemHost.setDefault(false);
      systemHost.setHostname("system");
View Full Code Here

      }
    }
    sql.append(" FROM host ");
    sql.append("WHERE identifier='" + id + "'");
    //sql.append("working=" + DbConnectionFactory.getDBTrue().replaceAll("'", ""));
    SQLQueryFactory sqlQueryFactory = new SQLQueryFactory(sql.toString());
    Query query = sqlQueryFactory.getQuery();

    List<Map<String, Serializable>> list = APILocator.getContentletAPI().DBSearch(query, user, respectFrontendRoles);
    if (1 < list.size())
      Logger.error(this, "More of one working version of host match the same identifier " + id + "!!");
    else if (list.size() == 0)
View Full Code Here

TOP

Related Classes of com.dotmarketing.business.query.SQLQueryFactory

Copyright © 2018 www.massapicom. 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.