/** * PUBLIC: * Add the cache index to the descriptor's cache settings. * This allows for cache hits to be obtained on non-primary key fields. * The primary key is always indexed in the cache. * Cache indexes are defined by their database column names. */ public void addCacheIndex(DatabaseField fields[]) { addCacheIndex(new CacheIndex(fields)); }
/** * PUBLIC: * Add the cache index to the descriptor's cache settings. * This allows for cache hits to be obtained on non-primary key fields. * The primary key is always indexed in the cache. * Cache indexes are defined by their database column names. */ public void addCacheIndex(String... fields) { addCacheIndex(new CacheIndex(fields)); }
/** * PUBLIC: * Add the cache index to the descriptor's cache settings. * This allows for cache hits to be obtained on non-primary key fields. * The primary key is always indexed in the cache. * Cache indexes are defined by their database column names. */ public void addCacheIndex(String... fields) { addCacheIndex(new CacheIndex(fields)); }
/** * PUBLIC: * Add the cache index to the descriptor's cache settings. * This allows for cache hits to be obtained on non-primary key fields. * The primary key is always indexed in the cache. * Cache indexes are defined by their database column names. */ public void addCacheIndex(DatabaseField fields[]) { addCacheIndex(new CacheIndex(fields)); }
/** * INTERNAL: * Process the index metadata */ public void process(MetadataDescriptor descriptor, String defaultColumnName) { if (m_columnNames.isEmpty() && (defaultColumnName != null)) { CachePolicy cachePolicy = descriptor.getClassDescriptor().getCachePolicy(); DatabaseField field = new DatabaseField(defaultColumnName); if (m_project.useDelimitedIdentifier()) { field.setUseDelimiters(true); } else if (m_project.getShouldForceFieldNamesToUpperCase() && !field.shouldUseDelimiters()) { field.useUpperCaseForComparisons(true); } cachePolicy.addCacheIndex(new DatabaseField[] {field}); } else { CacheIndex index = new CacheIndex(); if (this.updateable != null) { index.setIsUpdateable(this.updateable); } for (String column : m_columnNames) { index.addFieldName(column); } descriptor.getClassDescriptor().getCachePolicy().addCacheIndex(index); } }
existingIndex = new CacheIndex(fields); existingIndex.setIsUpdateable(false); existingIndex.setIsInsertable(false);
existingIndex = new CacheIndex(fields); existingIndex.setIsUpdateable(false); existingIndex.setIsInsertable(false);