spring-data

Is jar creation necessary to execute MR on a remote cluster

北战南征 提交于 2020-01-14 03:35:07
问题 I have been trying Spring Data for Hadoop to execute a MR job from my local Windows STS on a remote Hadoop cluster. The issue I face is mentioned in detail here There's a similar thread that has forced me to ask the below question. Is it necessary to first create a .jar file on my local windows machine(within the Eclipse/STS project's lib etc.) before it can be executed on a remote Hadoop cluster? Can't Spring Data simply push my code onto the remote cluster and trigger the execution? 来源:

Spring Boot Standard UUID codec not working with AbstractMongoClientConfiguration

拟墨画扇 提交于 2020-01-13 18:11:11
问题 I upgraded to Spring Boot 2.2.0.RELEASE and wanted to replace the now deprecated AbstractMongoConfiguration with AbstractMongoClientConfiguration. I am using codecRegistries.add(CodecRegistries.fromCodecs(new UuidCodec(UuidRepresentation.STANDARD))); to set the UUID Codec in the MongoDB to STANDARD (UUID) instead of Legacy Codec (LUUID). When looking into the database the Codec stays in the legacy format. Anybody else experienced the same problem? Old implementation (working): @Override

Two foreign keys as primary key

你离开我真会死。 提交于 2020-01-13 08:27:52
问题 How would I implement the following tables using hibernate annotations? Current code is: (stripped for brevity) User @Entity @Table(name = "user") public class User implements java.io.Serializable { @Id @GeneratedValue public Long getId() { return id; } } SocialNetwork @Entity @Table(name = "social_network") public class SocialNetwork implements java.io.Serializable { @Id @GeneratedValue public int getId() { return id; } } SocialProfile @Entity @Table(name = "social_profile") public class

Spring Data Pageable not supported as RequestParam in Feign Client

。_饼干妹妹 提交于 2020-01-13 06:09:08
问题 I have been trying to expose a Feign Client for my rest api. It takes Pageable as input and has PageDefaults defined. Controller: @GetMapping(value = "data", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Get Data", nickname = "getData") public Page<Data> getData(@PageableDefault(size = 10, page = 0) Pageable page, @RequestParam(value = "search", required = false) String search) { return service.getData(search, page); } And here is my feign client: @RequestMapping(method

straight_join in JPA or HIBERNATE

霸气de小男生 提交于 2020-01-13 05:22:10
问题 How to use select straight_join ... from ... in hibernate/jpa? 回答1: There is no straight_join for JPQL/JPA. You will need to use it in NativeQuery. entityManager.createNativeQuery(...); 回答2: It should be possible in the Hibernate 5.2.12 and MySQL version 8 using optimizer hint JOIN_FIXED_ORDER (the same effect as STRAIGHT_JOIN) More information available under the links: Jira ticket: https://hibernate.atlassian.net/browse/HHH-11906 Hibernate code change that allows this: https://github.com

Mongotemplate.updateFirst() doesn't update @LastModifiedDate

家住魔仙堡 提交于 2020-01-12 10:09:07
问题 I'm using annotation based configuration. @Configuration @Profile("default") @ComponentScan(basePackages = "com.*") @EnableMongoRepositories @EnableMongoAuditing public class ApplicationDataConfig .... And I also have @LastModifiedDate , @CreatedDate annotation set on fields of type org.joda.time.DateTime . When I use org.springframework.data.mongodb.repository.MongoRepository.save(entity) both the audit fields are updated just fine. But when I use org.springframework.data.mongodb.core

Mongotemplate.updateFirst() doesn't update @LastModifiedDate

◇◆丶佛笑我妖孽 提交于 2020-01-12 10:08:49
问题 I'm using annotation based configuration. @Configuration @Profile("default") @ComponentScan(basePackages = "com.*") @EnableMongoRepositories @EnableMongoAuditing public class ApplicationDataConfig .... And I also have @LastModifiedDate , @CreatedDate annotation set on fields of type org.joda.time.DateTime . When I use org.springframework.data.mongodb.repository.MongoRepository.save(entity) both the audit fields are updated just fine. But when I use org.springframework.data.mongodb.core

Joda Time and hibernate 4

早过忘川 提交于 2020-01-12 07:54:10
问题 I am using hibernate 4 with joda time and spring data jpa. Spring data provides annotations @CreadedOn @LastModifiedOn i am trying to use these two annotations.Below is a snapshot of my pojo @Entity @Table(name="restaurant") @Audited public class Restaurant { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String restaurantName; @CreatedDate @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime") // @Type(type = "org.jadira.usertype.dateandtime

Joda Time and hibernate 4

空扰寡人 提交于 2020-01-12 07:54:05
问题 I am using hibernate 4 with joda time and spring data jpa. Spring data provides annotations @CreadedOn @LastModifiedOn i am trying to use these two annotations.Below is a snapshot of my pojo @Entity @Table(name="restaurant") @Audited public class Restaurant { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String restaurantName; @CreatedDate @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime") // @Type(type = "org.jadira.usertype.dateandtime

Spring data query where column is null

北战南征 提交于 2020-01-12 04:08:06
问题 Suppose I have entities (getters/setters and various details omitted for brevity): @Entity class Customer{ ... @OneToMany(cascade = CascadeType.ALL, mappedBy = "customer") Collection<Coupon> coupons; } @Entity class Coupon{ ... @Temporal(value = TemporalType.TIMESTAMP) private Date usedOn; @ManyToOne(fetch = FetchType.LAZY) @NotNull Customer customer; } I wish retrieve all Coupons for a given Customer having null usedOn. I,'ve unsuccessfully defined a method in the CouponRepository as