Package org.conserve.tools

Examples of org.conserve.tools.ClassIdTuple


   * @throws SQLException
   */
  public ClassIdTuple getRealTableNameAndId(ConnectionWrapper cw,
      Class<?> propertyClass, Long propertyId) throws SQLException
  {
    ClassIdTuple res = null;
    String propertyTable = NameGenerator.getTableName(propertyClass,
        adapter);
    StringBuilder query = new StringBuilder("SELECT ");
    query.append(Defaults.REAL_CLASS_COL);
    query.append(",");
    query.append(Defaults.REAL_ID_COL);
    query.append(" FROM ");
    query.append(propertyTable);
    query.append(" WHERE ");
    query.append(Defaults.ID_COL);
    query.append("=?");
    PreparedStatement ps = cw.prepareStatement(query.toString());
    ps.setLong(1, propertyId);
    ResultSet rs = ps.executeQuery();
    if (rs.next())
    {
      String realName = rs.getString(1);
      if (realName == null)
      {
        res = new ClassIdTuple(propertyClass, propertyId);
      }
      else
      {
        Long realId = rs.getLong(2);
        try
View Full Code Here

TOP

Related Classes of org.conserve.tools.ClassIdTuple

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.