-
Bug
-
Resolution: Done
-
Major
-
5.2.0.Final
-
None
-
- Configure a custom "table-name" attribute for "db-persistence" in a repository in the Modeshape JBOSS subsystem
- Created table has the default name "MODESHAPE_REPOSITORY"
The attribute "table-name" in the "db-persistence" repository configuration for the JBOSS subsystem isn't set properly during startup. The DB persistence always uses the default table name "MODESHAPE_REPOSITORY".
The cause of this bug is in the class org.modeshape.jboss.subsystem.AddDatabasePersistence in modeshape-jbossas-subsystem.
Within the method "performRuntime" all ModelAttributes for DatabasePersistence are set for the persistenceConfig - except TABLE_NAME.
The following code should be inserted to record the ModelAttributes.TABLE_NAME property:
ModelNode tableName = TABLE_NAME.resolveModelAttribute(context, operation);
if (tableName.isDefined()) {
persistenceConfig.setString(TABLE_NAME.getFieldName(), tableName.asString());
}