Skip to content

Commit

Permalink
Fix README and shade ANTLR
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Apr 11, 2024
1 parent 94ab575 commit 28d54f7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ interface CatModel {
Assuming the domain model was already built, we could formulate a predicate:

```java
ExpressionServiceFactory expressionService = Expressions.forModel(domain);
ExpressionService expressionService = Expressions.forModel(domain);
ExpressionCompiler compiler = expressionService.createCompiler();
ExpressionCompiler.Context context = compiler.createContext(
Collections.singletonMap("c", domain.getType("CatModel"))
Expand All @@ -190,7 +190,7 @@ This would yield `true` as the age of the cat in the example is 19. This could a
```java
CriteriaBuilder<Cat> criteriaBuilder = criteriaBuilderFactory.create(entityManager, Cat.class, "cat");
ExpressionSerializer<WhereBuilder> serializer = expressionService.createSerializer(WhereBuilder.class);
ExpressionSerializer.Context context = serializer.createContext(
ExpressionSerializer.Context context = new PersistenceExpressionSerializerContext(
Collections.singletonMap("c", "cat")
);
serializer.serializeTo(context, predicate, criteriaBuilder);
Expand Down
32 changes: 32 additions & 0 deletions core/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.9.1</version>
<exclusions>
<exclusion>
<artifactId>org.abego.treelayout.core</artifactId>
<groupId>org.abego.treelayout</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -49,6 +55,32 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createSourcesJar>true</createSourcesJar>
<relocations>
<relocation>
<pattern>org.antlr.v4.runtime</pattern>
<shadedPattern>com.blazebit.expression.impl.antlr</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<includes>
<include>org.antlr:antlr4-runtime</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
Expand Down

0 comments on commit 28d54f7

Please sign in to comment.