/** * Gets the column to be indexed. * * @param columnName * the column name * @return the column to be indexed */ public IndexInfo getColumnToBeIndexed(String columnName) { IndexInfo idxInfo = new IndexInfo(columnName); if (columnToBeIndexed.contains(idxInfo)) { int index = columnToBeIndexed.indexOf(idxInfo); return getColumnsToBeIndexed().get(index); } return idxInfo; }
@Test public void testWithSingleValueConstructor() { IndexInfo indexInfo = new IndexInfo("personName"); indexInfo.setIndexType("KEYS"); indexInfo.setMaxValue(12); indexInfo.setMinValue(1); Assert.assertEquals(1, indexInfo.getMinValue().intValue()); Assert.assertEquals(1, indexInfo.getMinValue().intValue()); Assert.assertEquals("KEYS", indexInfo.getIndexType()); Assert.assertEquals("personName", indexInfo.getColumnName()); }
@Test public void testWithMultiValueConstructor() { IndexInfo indexInfo = new IndexInfo("personName",12,1,"KEYS", "personName"); indexInfo.setIndexType("KEYS"); indexInfo.setMaxValue(12); indexInfo.setMinValue(1); Assert.assertEquals(12, indexInfo.getMaxValue().intValue()); Assert.assertEquals(1, indexInfo.getMinValue().intValue()); Assert.assertEquals("KEYS", indexInfo.getIndexType()); Assert.assertEquals("personName", indexInfo.getColumnName()); }
/** * getJoinColumn method return ColumnInfo for the join column * * @param columnType * * @param String * joinColumnName. * @return ColumnInfo object columnInfo. */ private ColumnInfo getJoinColumn(TableInfo tableInfo, String joinColumnName, Class columnType) { ColumnInfo columnInfo = new ColumnInfo(); columnInfo.setColumnName(joinColumnName); columnInfo.setIndexable(true); IndexInfo indexInfo = new IndexInfo(joinColumnName); tableInfo.addToIndexedColumnList(indexInfo); columnInfo.setType(columnType); return columnInfo; }
/** * Add {@link DiscriminatorColumn} for schema generation. * * @param tableInfo * table info. * @param entityType * entity type. */ private void onInheritedProperty(TableInfo tableInfo, EntityType entityType) { String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn(); if (discrColumn != null) { ColumnInfo columnInfo = new ColumnInfo(); columnInfo.setColumnName(discrColumn); columnInfo.setType(String.class); columnInfo.setIndexable(true); IndexInfo idxInfo = new IndexInfo(discrColumn); tableInfo.addColumnInfo(columnInfo); tableInfo.addToIndexedColumnList(idxInfo); } }
IndexInfo indexInfo = new IndexInfo(((AbstractAttribute) column).getJPAColumnName(), indexedColumn.getMax(), indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName()); tableInfo.addToIndexedColumnList(indexInfo);
Assert.assertNotSame(embeddedColumnInfo, embedded2); IndexInfo indexInfo = new IndexInfo("personName"); indexInfo.setIndexType("KEYS"); indexInfo.setMaxValue(12);
&& indexedColumn.getIndexType().toLowerCase().equals(Constants.COMPOSITE)) IndexInfo indexInfo = new IndexInfo(c.getKey(), indexedColumn.getMax(), indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName()); tableInfo.addToIndexedColumnList(indexInfo); if (indexedColumn != null && indexedColumn.getName() != null) IndexInfo indexInfo = new IndexInfo(jpaName, indexedColumn.getMax(), indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName()); tableInfo.addToIndexedColumnList(indexInfo); if (indexedColumn != null && indexedColumn.getName() != null) IndexInfo indexInfo = new IndexInfo(jpaName, indexedColumn.getMax(), indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName()); tableInfo.addToIndexedColumnList(indexInfo);