
com.draagon.meta.manager.db.defs.BaseTableDef Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metaobjects-omdb Show documentation
Show all versions of metaobjects-omdb Show documentation
Relational Database ObjectManager libraries for MetaData-driven development.
The newest version!
package com.draagon.meta.manager.db.defs;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseTableDef extends BaseDef {
private List columns = new ArrayList();
public BaseTableDef( NameDef name ) { //, List cols ) {
super( name );
//setColumns( cols );
}
public List getColumns() {
return columns;
}
public void addColumn( ColumnDef col ) {
col.setBaseTable( this );
columns.add( col );
}
public ColumnDef getColumn( String colName ) {
for( ColumnDef col : columns ) {
if ( col.getName().equals( colName )) return col;
}
return null;
}
public String toString() {
StringBuilder sb = new StringBuilder( getClass().getSimpleName() );
sb.append( " [" ).append( getNameDef() ).append( "]{" );
boolean first = true;
for( ColumnDef col : columns ) {
if ( first ) first = false;
else sb.append( "," );
sb.append( col.getName() );
}
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy