DBAccessProvider

Property Value
Interface Type extra-core
Full Class Name com.fr.db.fun.DBAccessProvider

Background and Use Cases

FineReport and the decision-making platform store management data in finedb (which supports external databases). Through the DBAccessProvider interface, plugin developers can extend the data tables in finedb without requiring users to create tables manually.

Interface Definition

package com.fr.db.fun;

import com.fr.plugin.db.accessor.DBAccessible;
import com.fr.stable.fun.mark.Mutable;

public interface DBAccessProvider extends Mutable, DBAccessible {
    String XML_TAG = "DBAccessProvider";
    int CURRENT_LEVEL = 1;
}
package com.fr.plugin.db.accessor;

import com.fr.stable.db.dao.DAOProvider;

public interface DBAccessible extends DBInjectable {
    DAOProvider[] registerDAO();
}
package com.fr.plugin.db.accessor;

import com.fr.stable.db.accessor.DBAccessor;

public interface DBInjectable {
    void onDBAvailable(DBAccessor accessor);
}
package com.fr.stable.db.dao;

import com.fr.stable.db.data.DataRecord;

public interface DAOProvider<T extends DataRecord> {
    Class<T> getEntityClass();
    Class<? extends BaseDAO<T>> getDAOClass();
}
package com.fr.stable.db.accessor;

import com.fr.stable.db.action.DBAction;

public interface DBAccessor {
    <T> T runQueryAction(DBAction<T> action) throws Exception;
    <T> T runDMLAction(DBAction<T> action) throws Exception;
}
package com.fr.stable.db.action;

import com.fr.stable.db.dao.DAOContext;

public interface DBAction<T> {
    T run(DAOContext context) throws Exception;
}

Supported Versions

Product Version Support
FR 10.0 Supported
FR 11.0 Supported

Plugin Registration

Add the following node in plugin.xml:

<extra-core>
    <DBAccessProvider class="your class name"/>
</extra-core>

How It Works

The system loads all declared DBAccessProvider interface instances during PluginDBManager initialization. This manager provides a persistence invocation entry point for business units through DBContext.

Open Source Examples

Disclaimer: All open source examples in the documentation are developed and provided by developers for reference and learning purposes only. Developers and the official team have no obligation to provide instruction or guidance on open source examples. Commercial use is strictly prohibited; any consequences from commercial use are the sole responsibility of the user.

results matching ""

    No results matching ""