Skip to content
Advertisement

Tag: spring

Read a word (.docx) file in java

I have a word document which was generated with docx4j, when i unzip the docx file, the contents of folder is the contents of ./word/document.xml is as below the relationship xml has below relationship when we unzip chunk.docx it has below file contents and the ./word/document.xml has below contents relationship document xml has below contents similarly when i unzip the

Avoid duplication on manyToMany relationships with 3 tables

I’m trying to implement a User system with roles and privileges. So I have 5 tables: users roles privileges users_roles roles_privileges My class user owns the relationship users_roles and the class roles owns the relationship roles_privileges. To describe my problem lets say I have the following in my database (simplified): users: user roles: 0, 1 privileges: a, b, c, d

Spring, Jpa : One To Many Error when the list contains values

I want to return a Profile Object in JSON containing a list of login details associated with a social network. Everything works correctly when the “reseaux_sociaux” table is empty. For my status table I get my statuses in JSON format in my Profile object. However, when “reseaux_sociaux” contains values then I get the error below and my Profile object in

Is there any way to use something like List.class?

I’m using SpringBoot with OpenAPI and SwaggerUI to implement a rest api. I want to annotate a @GetMapping method with @ApiResponses to provide the schema of the response, but I’m struggling with the parameter implementation of @Schema. The return type of my method is List<ScanDTO>, so I tried the following: But this doesn’t work. Things like ScanDTO.class would work. The

@Value not getting the value from application.properties

im trying to get a value from the application.properties in a Spring boot app. The class is defined with the tag @Component, I already tried @Service too, and with @PropertySource(“classpath:application.properties”) and without the @PropertySource but in any case they get the value. The interface is defined like this And the superior interface In any case I tried without implementing the

Error while querying tables using hibernate

I am trying to query a table called student in MySQL. This is the structure: Here is the java code which I use to query: This is the error message: Here is the image of the referenced libraries: Insertion into table is working correctly. Only querying isn’t. What is the error here? Please comment if extra information is needed. UPDATE:

Advertisement