Skip to content

Commit

Permalink
Improve README.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz authored Mar 8, 2021
1 parent 8394074 commit 33d35c2
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ 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>

```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();
```java
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`.

Expand Down

0 comments on commit 33d35c2

Please sign in to comment.