use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableNameHandler method attributeCompletionProposals.
public ICompletionProposal[] attributeCompletionProposals(IJavaProject javaProject, Node node, String attributeName, String start, int offset) {
List tables = new ArrayList();
HibernateNature nature = HibernateNature.getHibernateNature(javaProject);
if (nature != null) {
tables = nature.getMatchingTables(start);
}
List proposals = new ArrayList();
for (Iterator iter = tables.iterator(); iter.hasNext(); ) {
ITable element = (ITable) iter.next();
proposals.add(new CompletionProposal(element.getName(), offset, start.length(), element.getName().length(), null, null, null, null));
}
return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newTable.
@Override
public ITable newTable(String name) {
Table target = new Table(name);
target.setPrimaryKey(new PrimaryKey());
return facadeFactory.createTable(target);
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newTable.
@Override
public ITable newTable(String name) {
Table target = new Table(name);
target.setPrimaryKey(new PrimaryKey(target));
return facadeFactory.createTable(target);
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newTable.
@Override
public ITable newTable(String name) {
Table target = new Table(name);
target.setPrimaryKey(new PrimaryKey());
return facadeFactory.createTable(target);
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeImpl method initializeTableMappings.
@Override
protected void initializeTableMappings() {
HashSet<ITable> tableMappings = new HashSet<ITable>();
Iterator<Table> origin = getMetadata().collectTableMappings().iterator();
while (origin.hasNext()) {
ITable table = getFacadeFactory().createTable(origin.next());
tableMappings.add(table);
}
setTableMappings(tableMappings);
}
Aggregations