by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:23

    sothawo on 3.2.x

    DATAES-937 - Repository queries… (compare)

  • 06:18
    christophstrobl closed #459
  • 06:18

    christophstrobl on DATACMNS-1762

    (compare)

  • 06:17

    christophstrobl on master

    DATACMNS-1762 - Remove Reactive… DATACMNS-1762 - Extract Nullabl… DATACMNS-1762 - Support Optiona… and 2 more (compare)

  • Sep 24 22:53
    jxblum synchronize #467
  • Sep 24 22:51
    jxblum edited #467
  • Sep 24 22:51
    jxblum edited #467
  • Sep 24 22:49
    jxblum synchronize #467
  • Sep 24 20:51
    jxblum edited #467
  • Sep 24 20:51
    jxblum edited #467
  • Sep 24 20:51
    jxblum edited #467
  • Sep 24 20:51
    jxblum edited #467
  • Sep 24 20:51
    jxblum opened #467
  • Sep 24 20:37

    sothawo on 4.0.x

    DATAES-937 - Repository queries… (compare)

  • Sep 24 20:14

    sothawo on master

    DATAES-937 - Repository queries… (compare)

  • Sep 24 20:14
    sothawo closed #525
  • Sep 24 20:13
    sothawo opened #525
  • Sep 24 19:19

    sothawo on 3.2.x

    DATAES-896 - Use mainField pro… (compare)

  • Sep 24 19:19
    sothawo closed #524
  • Sep 24 19:18
    sothawo opened #524
Mark Paluch
@mp911de
Envers is an Add-on to Hibernate. MongoDB isn't affiliated with Hibernate at all
Rohan Kumar
@rohanKanojia
Hi guys, I'm trying to access couchbase db running in kubernetes from spring
I have defined connection configuration like this:
~/work/repos/kubernetes-java-sample/maven/webapp : $ cat src/main/resources/application.properties 
spring.couchbase.bootstrap-hosts=192.168.39.77
spring.couchbase.bootstrap-port=32099
spring.couchbase.bucket.name=books
spring.couchbase.bucket.password=123456
However, this doesn't seem to override default port. It gives me this error: java.net.ConnectException: Connection refused: /192.168.39.77:8091
Does anyone know how to override default port in spring data couchbase?
Adrien Lecharpentier
@alecharp
Hello @mp911de. From spring-data-envers issue tracker, and local experimentation, something changed recently which breaks the library behaviour. spring-projects/spring-data-envers#250 sums up exactly what I'm facing. If you (or anyone) could have a look it would be great. Thanks!
Christopher Davis
@cdavispax8
Hi all, how would I go about using aggregates in a spring data elasticsearch query? Do I have to write the query out manually?
The example is I have an index containing products and I just need to see a distinct list of vendors among those products.
1 reply
Al Grant
@bigal_nz_twitter

I have this:

public interface PlanServiceUserGen extends PlanService {
    Optional<PlanTaskViewDTOUserGen> getPlanWithTasks(Long id);
}

but there is no method on PlanService defining getPlanWithTasks - so how is this even working? (As it stands it only retreives one of the linked Tasks)

Fly-Away
@Fly-Away

Envers is an Add-on to Hibernate. MongoDB isn't affiliated with Hibernate at all

I see thank you.

How about using r2dbc with envers? I need reactive library with database auditing tool like envers, any database will do, nosql or rdbms

Mark Paluch
@mp911de
Spring Data R2DBC isn't using JPA/Hibernate either.
Fly-Away
@Fly-Away

Spring Data R2DBC isn't using JPA/Hibernate either.

Oohh i see, is there any auditing library for Spring Data R2DBC?

Mark Paluch
@mp911de
Spring Data R2DBC ships with built-in auditing support, that is the created/modified user and date
Fly-Away
@Fly-Away

Spring Data R2DBC ships with built-in auditing support, that is the created/modified user and date

Woah very cool, did it have auto create a revision info table pr some audit table with revision history?

Jiddere Jnr
@chairmo

Some should help me here please, I am unable to post from my the front. this is my code: @Entity
@Getter
@Setter
public class Education extends BaseEntity {

private String school;
private String gradeObtained;
@ManyToOne(fetch = FetchType.LAZY)
private Qualification qualification;
@ManyToOne(fetch = FetchType.LAZY)
private Courses course;

}
@Entity
@Getter
@Setter
public class Qualification {
private String name;
}

//service
@Transactional
@Override
public Education addEducation(Education record) {
return repository.save(record);
}

//json

{ "school": "OAU",
"gradeObtained": "2.2",
"qualification": 4,
"course": 10,
"startDate": "14/10/2001",
"finishDate": "15/12/2019",
"ippis": "4133"
}

Jiddere Jnr
@chairmo
no int/Int-argument constructor/factory method to deserialize from Number value (4); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.chairmo.staffcadre.model.entities.Qualification (although at least one Creator exists):
Jiddere Jnr
@chairmo
Any help please any
one here
顾凡
@GuideFourthW
@karshil2309
MongoFJMatchId byId = mongoFootMacthIdMapper.findById(mongoEvent.getMatchId());
told me java.lang.NoClassDefFoundError: com/mongodb/connection/QueryResult
my mongodb-driver-core version is 4.0.3
Springboot is 2.3.0
Fly-Away
@Fly-Away

Some should help me here please, I am unable to post from my the front. this is my code: @Entity
@Getter
@Setter
public class Education extends BaseEntity {

private String school;
private String gradeObtained;
@ManyToOne(fetch = FetchType.LAZY)
private Qualification qualification;
@ManyToOne(fetch = FetchType.LAZY)
private Courses course;

}
@Entity
@Getter
@Setter
public class Qualification {
private String name;
}

//service
@Transactional
@Override
public Education addEducation(Education record) {
return repository.save(record);
}

//json

{ "school": "OAU",
"gradeObtained": "2.2",
"qualification": 4,
"course": 10,
"startDate": "14/10/2001",
"finishDate": "15/12/2019",
"ippis": "4133"
}

You can't add qualification as integer and course as integer into Object, you should find the object properties and set into the object, start complete stackoverflow question and share me the link

Jiddere Jnr
@chairmo
@karshil2309 followed the link it talk about removing a maven dependency which i don't have on my classpath.
Iszuhbelle
@iszuhbelle_twitter
image.png
hey guys I need help do I have to generate constructor using fields and getter or setter?
huifer
@huifer
How should I get it PersonRepository from spring
image.png
All I get now are proxy objects. How can I get the proxy objects
Bruno de Queiroz
@bruno.queiroz_gitlab
Hi guys, I'm having a weird problem when trying to setup a spring-boot kotlin application with spring-data-elasticsearch, apparently all annotations under a data class are not working. Have any of you guys experienced that?
but written in kotlin
I know back in the days kotlin had problems dealing with some annotations but afaik spring-data annotations weren't a problem.
Bruno de Queiroz
@bruno.queiroz_gitlab
apparently the problem is in the SimpleReactiveElasticsearchRepository which doesn't extend AbstractElasticsearchRepository therefore the index is not created at the time the repository bean is created, meaning that the properties set in @Document, @Setting, @Field, etc wont work
Bruno de Queiroz
@bruno.queiroz_gitlab
is that assumption correct? :point_up:
Peter-Josef Meisch
@sothawo
@bruno.queiroz_gitlab AbstractElasticearchRepository is the base class for the non-reactive classes. Complete support for reactive classes with index creation with mappings, settings, aliases etc. is available since Spring Data Elasticsearch 4.1.M2, released last week.
GHKosovo
@GHKosovo
Hey guys I meet some problems like this "org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier;)V", spring-data-redis version is 2.2.0 and jedis version is 3.1.0.my configuration file:
image.png
Daniil Mikhaylov
@mdsina

Hi there!
I have questions about EntityCallback
I do all the same as in that chapter https://docs.spring.io/spring-data/jdbc/docs/current/reference/html/#entity-callbacks
But my EntityCallback beans looks like not called by anyone

@Component
public class ProcedureBeforeSaveCallback implements ReactiveBeforeSaveCallback<ProcedureEntity> {
    @Override
    public Publisher<ProcedureEntity> onBeforeSave(
        ProcedureEntityentity, String collection
    ) {
        return Mono.just(entity); // there I put my debugger breakpoint
    }
}

Where my ReactiveBeforeSaveCallback is

@FunctionalInterface
public interface ReactiveBeforeSaveCallback<T> extends EntityCallback<T> {

    Publisher<T> onBeforeSave(T entity, String collection);
}

To insert my data I using DatabaseClient

return client.insert()
                        .into(ProcedureEntity.class)
                        .using(procedureEntity)
                        .then();

Did DatabaseClient work with EntityCallback API?
Thanks

Also I'm not sure who should call DefaultReactiveEntityCallbacks but I didn't see any invocations of methods from that implementation

Preben Asmussen
@pax95

Hi guys
I'm using the pageable support from Spring data, but want to hide the sorting information in both the request and response.
The response returns a Slice of data with the pagination info of the Slice at the bottom.

"pageable": { "sort": { "sorted": false, "unsorted": true, "empty": true }, "offset": 0, "pageNumber": 0, "pageSize": 20, "paged": true, "unpaged": false }, "sort": { "sorted": false, "unsorted": true, "empty": true }, "number": 0, "size": 20, "numberOfElements": 1, "first": true, "last": true, "empty": false }

Is there any way to remove the sort information from the response ?

Luis Vargas
@luisvt
you have to use a custom serializer
for example I used this:
package com.hatshop.server.utils

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
import org.springframework.boot.jackson.JsonComponent
import org.springframework.data.domain.Page

@JsonComponent
class PageSerializer extends JsonSerializer<Page<Object>> {
    @Override
    void serialize(Page<Object> value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeStartObject()
        gen.writeNumberField("size", value.size)
        gen.writeNumberField("totalElements", value.totalElements)
        gen.writeNumberField("totalPages", value.totalPages)
        gen.writeNumberField("number", value.number)
        gen.writeObjectField("items", value.content)
        gen.writeEndObject()
    }
}
Nikolas Mavropoylos
@ProIcons
do JPA's SpEL works on nativeQueries?
David Barda
@davebarda
Hey, is there any way to write test that checks that a repository find is using an index(spring data mongo)?
Greg L. Turnquist
@gregturn
@huifer The thing you are poking at is a proxy by design. There is no "real" version of that underneath the proxy. Instead there is a worker class that does all the work, but is made to respond to method calls as defined in the interface. If you want to grab a copy, either supply a PersonRepository to an @Bean method, and you'll have it, or feed it as a constructor argument to a Spring bean (@Service or @Controller or @RestController or whatever), and when Spring creates it, it will automatically inject it into the constructor. See?
James Howe
@OrangeDog
In short - you get an implementation of the repository interface by asking for a bean of the interface type
Greg L. Turnquist
@gregturn
Yes.
James Howe
@OrangeDog
There is no class, it's dynamically generated