1 24 25 package org.objectweb.cjdbc.controller.cache.result; 26 27 import org.objectweb.cjdbc.common.xml.DatabasesXmlTags; 28 29 36 public class CachingGranularities 37 { 38 42 public static final int DATABASE = 0; 43 44 48 public static final int TABLE = 1; 49 50 54 public static final int COLUMN = 2; 55 56 61 public static final int COLUMN_UNIQUE = 3; 62 63 69 public static final String getGranularityName(int cacheGrain) 70 { 71 switch (cacheGrain) 72 { 73 case DATABASE : 74 return "DATABASE"; 75 case TABLE : 76 return "TABLE"; 77 case COLUMN : 78 return "COLUMN"; 79 case COLUMN_UNIQUE : 80 return "COLUMN_UNIQUE"; 81 default : 82 return "UNSUPPORTED"; 83 } 84 } 85 86 94 public static final String getGranularityXml(int cacheGrain) 95 { 96 switch (cacheGrain) 97 { 98 case DATABASE : 99 return DatabasesXmlTags.VAL_database; 100 case TABLE : 101 return DatabasesXmlTags.VAL_table; 102 case COLUMN : 103 return DatabasesXmlTags.VAL_column; 104 case COLUMN_UNIQUE : 105 return DatabasesXmlTags.VAL_columnUnique; 106 default : 107 return DatabasesXmlTags.VAL_noInvalidation; 108 } 109 } 110 } 111 | Popular Tags |