Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
<version>${querydsl.version}</version>
</dependency>

<!-- Dependency for Third-Party E2 violation -->
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>3.2.4</version>
</dependency>

<!-- Test -->
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

import javax.persistence.Convert; // Noncompliant

@Convert
public class ThirdPartyDataMappingPersistanceNotOk {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

import javax.persistence.Converter; // compliant

@Converter
// OK - just for demonstration purpose. A reasonable example can be found here:
// https://github.com/devonfw/devon4j/blob/master/documentation/guide-jpa.asciidoc#entities-and-datatypes
public class ThirdPartyDataMappingPersistanceOk {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

import com.mysema.query.jpa.impl.JPAQuery; // Noncompliant

public class ThirdPartyMysemaNotOk {

JPAQuery jpaQuery;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

import com.querydsl.jpa.impl.JPAQuery; // compliant

public class ThirdPartyMysemaOk {

JPAQuery<Integer> jpaQuery;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

import static com.google.common.base.Objects.equal; // Noncompliant

public class ThirdPartyObjectNotOk {

boolean result = equal(1, 1);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.devonfw.sample.archunit.general.dataaccess.violations;

// compliant: standard java object method equals()
public class ThirdPartyObjectOK {

boolean result1 = java.util.Objects.equals(1, 1);

}