Git Product home page Git Product logo

Comments (9)

dmanix avatar dmanix commented on May 22, 2024 1

7.1.0 has been released. Let me know if it works.

Yes, it works. Thanks!

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 22, 2024

From what I can see in code - it should work.
How are you providing options to the annotation processor?

from infobip-spring-data-querydsl.

dmanix avatar dmanix commented on May 22, 2024

I was doing it in some different ways, two examples of maven snippets below:

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
	      <source>1.8</source>
	      <target>1.8</target>
	      <generatedSourcesDirectory>${project.build.directory}/generated-sources/annotations/</generatedSourcesDirectory>
	      <annotationProcessors>
		      <annotationProcessor>
			      com.infobip.spring.data.jdbc.annotation.processor.SpringDataJdbcAnnotationProcessor
		      </annotationProcessor>                      
	      </annotationProcessors>   
	      <compilerArgs>
		      <arg>-Aquerydsl.generatedAnnotationClass=javax.annotation.Generated</arg>
	      </compilerArgs>                   
      </configuration>
</plugin>
<plugin>
	<groupId>com.mysema.maven</groupId>
	<artifactId>apt-maven-plugin</artifactId>
	<version>1.1.3</version>
	<executions>
		<execution>
			<goals>
				<goal>process</goal>
			</goals>
			<configuration>
				<outputDirectory>${project.basedir}/target/generated-sources/annotations</outputDirectory>
				<processor>com.infobip.spring.data.jdbc.annotation.processor.SpringDataJdbcAnnotationProcessor</processor>
				<options>
					<querydsl.generatedAnnotationClass>javax.annotation.Generated</querydsl.generatedAnnotationClass>
				</options>
			</configuration>
		</execution>                   
	</executions>
</plugin>

I am pretty sure these options are recognized by processor (in both cases) as while I run it under debugger, they are included in Options Map: processingEnv.getOptions() in CustomSpringDataJdbcConfiguration constructor.

From what I looked at the code I noticed that these options are passed to CodegenModule from DefaultConfiguration but are not added to SQLCodegenModule from SpringDataJdbcConfiguration.

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 22, 2024

Support can be added.
infobip-spring-data-querydsl uses both the regular CodegenModule and SQLCodegenModule.
SQLCodegenModule has no code anywhere in querydsl that binds CodegenModule.GENERATED_ANNOTATION_CLASS to anything so it relies on the default it inherits from CodegenModule and that one sets it to

bindInstance(GENERATED_ANNOTATION_CLASS, GeneratedAnnotationResolver.resolveDefault());

if configure method is invoked.

I've added this to master - f73ac7f so let me know if this is it or you need something else.

from infobip-spring-data-querydsl.

dmanix avatar dmanix commented on May 22, 2024

Yes, this is exactly what I need.

from infobip-spring-data-querydsl.

dmanix avatar dmanix commented on May 22, 2024

BTW, I have one other question. I have a problem with setting up spring data jdbc with querydsl - I get runtime error:
org.springframework.data.repository.core.support.UnsupportedFragmentException: Repository com.atende.db.metadata.jdbcrepository.ActionRepository implements org.springframework.data.querydsl.QuerydslPredicateExecutor but JdbcRepositoryFactory does not support Querydsl!
I have described it in details on stackoverflow: https://stackoverflow.com/questions/72599490/spring-data-jdbc-querydsl-error-jdbcrepositoryfactory-does-not-support-query
Do you have any idea if I am missing anything or such use case is not supported yet in Spring data JDBC?

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 22, 2024

I've provided the full answer on stackoverflow - try removing the @EnableJdbcRepositories first but it's likely something else is amiss. Check your classpath and check against the Spring setup that is used in jdbc module tests.

from infobip-spring-data-querydsl.

lpandzic avatar lpandzic commented on May 22, 2024

Yes, this is exactly what I need.

7.1.0 has been released. Let me know if it works.

from infobip-spring-data-querydsl.

dmanix avatar dmanix commented on May 22, 2024

I've provided the full answer on stackoverflow - try removing the @EnableJdbcRepositories first but it's likely something else is amiss. Check your classpath and check against the Spring setup that is used in jdbc module tests.

I did what you suggested but now have another problem - I have answered on stack overflow.

from infobip-spring-data-querydsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.