Skip to content

jcasbin/hibernate-adapter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

hibernate-adapter

codebeat badge GitHub Actions Coverage Status javadoc Maven Central Gitter

Load policy from Hibernate or save policy to it.

Usage

First, Introduce it in the pom.xml:

<dependency>
    <groupId>org.casbin</groupId>
    <artifactId>hibernate-adapter</artifactId>
    <version>1.0.0</version>
</dependency>

Then you can use it in your project like this:

Enforcer e = new Enforcer("examples/rbac_with_domains_model.conf");
Adapter adapter = new HibernateAdapter(DRIVER, URL, USERNAME, PASSWORD, true);
e.setAdapter(adapter);
e.loadPolicy();

If you use Oracle, the last entry of the parameter must be set to true.

Supported Databases

Currently supported databases:

MySQL
Oracle
SQL Server 2012