Changeset 5679
- Timestamp:
- Jun 29, 2011, 1:47:33 PM (12 years ago)
- Location:
- trunk/src/core/net/sf/basedb/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/ExtendedProperties.java
r5431 r5679 264 264 boolean insertable = XMLUtil.getBooleanAttribute(property, "insert", true); 265 265 boolean updateable = XMLUtil.getBooleanAttribute(property, "update", true); 266 boolean averagable = XMLUtil.getBooleanAttribute(property, "averagable", type.isNumerical());267 266 String avgMethod = property.getAttributeValue("averagemethod"); 268 267 Formula.AverageMethod averageMethod = null; … … 271 270 averageMethod = Formula.AverageMethod.valueOf(avgMethod.toUpperCase()); 272 271 } 273 else if ( averagable)272 else if (type.isNumerical()) 274 273 { 275 274 averageMethod = Formula.AverageMethod.ARITHMETIC_MEAN; -
trunk/src/core/net/sf/basedb/core/RawDataTypes.java
r5574 r5679 335 335 String name = Values.getStringOrNull(el.getAttributeValue("name")); 336 336 String description = Values.getStringOrNull(el.getAttributeValue("description")); 337 String storage = el.getAttributeValue("storage");338 337 String table = Values.getStringOrNull(el.getAttributeValue("table")); 339 338 int channels = XMLUtil.getIntAttribute(el, "channels", 2); … … 356 355 usedNames.add("id:" + id); 357 356 usedNames.add("name:" + name); 358 if ("database".equals(storage)) 359 { 360 if (!engine.isValidTableName(table)) 361 { 362 throw new InvalidDataException("Invalid table for raw data type '" + 363 id +"' in file '" + xmlFile + "': table=" + table); 364 } 365 if (usedNames.contains("table:" + table)) 366 { 367 throw new InvalidDataException("Duplicate table for raw data type '" + 368 id +"' in file '" + xmlFile + "': table=" + table); 369 } 370 usedNames.add("table:" + table); 371 } 372 else 373 { 374 throw new ConfigurationException("Attribute storage='" + storage + 375 "' is no longer supported. Please remove declaration for <rawdatatype id='" + id + 376 "'> from file '" + xmlFile + "'"); 377 } 357 358 if (!engine.isValidTableName(table)) 359 { 360 throw new InvalidDataException("Invalid table for raw data type '" + 361 id +"' in file '" + xmlFile + "': table=" + table); 362 } 363 if (usedNames.contains("table:" + table)) 364 { 365 throw new InvalidDataException("Duplicate table for raw data type '" + 366 id +"' in file '" + xmlFile + "': table=" + table); 367 } 368 usedNames.add("table:" + table); 369 378 370 if (channels <= 0) 379 371 { … … 435 427 if (type == Type.STRING && length > 255) type = Type.TEXT; 436 428 boolean nullable = XMLUtil.getBooleanAttribute(property, "null", true); 437 boolean averagable = XMLUtil.getBooleanAttribute(property, "averagable", type.isNumerical());438 429 String avgMethod = property.getAttributeValue("averagemethod"); 439 430 Formula.AverageMethod averageMethod = null; … … 442 433 averageMethod = Formula.AverageMethod.valueOf(avgMethod.toUpperCase()); 443 434 } 444 else if ( averagable)435 else if (type.isNumerical()) 445 436 { 446 437 averageMethod = Formula.AverageMethod.ARITHMETIC_MEAN; -
trunk/src/core/net/sf/basedb/core/dtd/extended-properties.dtd
r5432 r5679 41 41 insert (true|false) "true" 42 42 update (true|false) "true" 43 averagable (true|false) #IMPLIED44 43 averagemethod (none|arithmetic_mean|geometric_mean|quadratic_mean|min|max) #IMPLIED 45 44 > -
trunk/src/core/net/sf/basedb/core/dtd/raw-data-types.dtd
r5432 r5679 28 28 name CDATA #REQUIRED 29 29 channels CDATA #REQUIRED 30 storage (file|database) "database"31 30 table CDATA #IMPLIED 32 31 description CDATA #IMPLIED … … 43 42 length CDATA #IMPLIED 44 43 null (true|false) "true" 45 averagable (true|false) #IMPLIED46 44 averagemethod (none|arithmetic_mean|geometric_mean|quadratic_mean|min|max) #IMPLIED 47 45 channel CDATA #IMPLIED
Note: See TracChangeset
for help on using the changeset viewer.