Skip to content

Commit

Permalink
Merge pull request #129 from eclipse/use-model-mapping-semistructured
Browse files Browse the repository at this point in the history
Use attributes from semitructured project
  • Loading branch information
otaviojava authored Jul 28, 2024
2 parents 14d92da + 2639d72 commit cb121b6
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 437 deletions.
24 changes: 0 additions & 24 deletions jnosql-static-metamodel/jnosql-metamodel-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,6 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/metadata/</outputDirectory>
<resources>
<resource>
<directory>src/main/java/org/eclipse/jnosql/metamodel/</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ public String getSuperClass() {
return superClass;
}

public boolean containsStringAttribute() {
return this.fields.stream().anyMatch(FieldModel::isStringAttribute);
}

public boolean containsBooleanAttribute() {
return this.fields.stream().anyMatch(FieldModel::isBooleanAttribute);
}

public boolean containsCriteriaAttribute() {
return this.fields.stream().anyMatch(FieldModel::isCriteriaAttribute);
}

@Override
public String toString() {
return "EntityModel{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

class FieldAnalyzer implements Supplier<List<FieldModel>> {


private final Element field;
private final ProcessingEnvironment processingEnv;
private final TypeElement entity;
Expand Down Expand Up @@ -187,9 +188,9 @@ private boolean isBasicField(Entity fieldEntity, Embeddable embeddable) {

private String className(String className) {
return switch (className) {
case "java.lang.String" -> "org.eclipse.jnosql.metamodel.StringAttribute";
case "java.lang.Boolean", "boolean" -> "org.eclipse.jnosql.metamodel.BooleanAttribute";
default -> "org.eclipse.jnosql.metamodel.CriteriaAttribute";
case "java.lang.String" -> FieldModel.STRING_ATTRIBUTE;
case "java.lang.Boolean", "boolean" -> FieldModel.BOOLEAN_ATTRIBUTE;
default -> FieldModel.CRITERIA_ATTRIBUTE;
};
}

Expand Down
Loading

0 comments on commit cb121b6

Please sign in to comment.