1 23 24 package org.continuent.sequoia.controller.sql.schema; 25 26 import java.io.Serializable ; 27 28 42 public class AliasedDatabaseTable implements Serializable 43 { 44 private static final long serialVersionUID = 7082201367853814224L; 45 46 47 private DatabaseTable table; 48 49 50 private String alias; 51 52 58 public AliasedDatabaseTable(DatabaseTable table, String alias) 59 { 60 if (table == null) 61 throw new IllegalArgumentException ( 62 "Illegal null database table in AliasedDatabaseTable constructor"); 63 64 this.table = table; 65 this.alias = alias; 66 } 67 68 74 public DatabaseTable getTable() 75 { 76 return table; 77 } 78 79 84 public String getAlias() 85 { 86 return alias; 87 } 88 89 96 public boolean equals(Object other) 97 { 98 if ((other == null) || !(other instanceof AliasedDatabaseTable)) 99 return false; 100 101 AliasedDatabaseTable ad = (AliasedDatabaseTable) other; 102 if (alias == null) 103 return (ad.getAlias() == null) && table.equals(ad.getTable()); 104 else 105 return alias.equals(ad.getAlias()) && table.equals(ad.getTable()); 106 } 107 } 108 | Popular Tags |