Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-2633: Upgraded to Hibernate Tools 5.1.0.Alpha2
FORGE-2644: Refactored DatabaseTableSelectionStep for better performance and allowing selection of catalog + schema
- Loading branch information
Showing
8 changed files
with
364 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
...tools/impl/src/main/java/org/jboss/forge/addon/database/tools/generate/DatabaseTable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright 2016 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.addon.database.tools.generate; | ||
|
||
/** | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public final class DatabaseTable | ||
{ | ||
private final String catalog; | ||
private final String schema; | ||
private final String name; | ||
|
||
/** | ||
* @param catalog | ||
* @param schema | ||
* @param name | ||
*/ | ||
public DatabaseTable(String catalog, String schema, String name) | ||
{ | ||
super(); | ||
this.catalog = catalog; | ||
this.schema = schema; | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* @return the catalog | ||
*/ | ||
public String getCatalog() | ||
{ | ||
return catalog; | ||
} | ||
|
||
/** | ||
* @return the schema | ||
*/ | ||
public String getSchema() | ||
{ | ||
return schema; | ||
} | ||
|
||
/** | ||
* @return the name | ||
*/ | ||
public String getName() | ||
{ | ||
return name; | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((catalog == null) ? 0 : catalog.hashCode()); | ||
result = prime * result + ((name == null) ? 0 : name.hashCode()); | ||
result = prime * result + ((schema == null) ? 0 : schema.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) | ||
{ | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
DatabaseTable other = (DatabaseTable) obj; | ||
if (catalog == null) | ||
{ | ||
if (other.catalog != null) | ||
return false; | ||
} | ||
else if (!catalog.equals(other.catalog)) | ||
return false; | ||
if (name == null) | ||
{ | ||
if (other.name != null) | ||
return false; | ||
} | ||
else if (!name.equals(other.name)) | ||
return false; | ||
if (schema == null) | ||
{ | ||
if (other.schema != null) | ||
return false; | ||
} | ||
else if (!schema.equals(other.schema)) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return "DatabaseTable [catalog=" + catalog + ", schema=" + schema + ", name=" + name + "]"; | ||
} | ||
} |
Oops, something went wrong.