草庐IT

core-data-migration

全部标签

java - Spring Data Rest/Spring Hateoas 自定义 Controller - PersistentEntityResourceAssembler

我正在尝试向RepositoryRestResource自动生成的端点添加一些额外的业务逻辑。请看下面的代码:资源:@RepositoryRestResource(collectionResourceRel="event",path="event")publicinterfaceEventRepositoryextendsPagingAndSortingRepository{}Controller:@RepositoryRestController@RequestMapping(value="/event")publicclassEventController{@Autowiredpr

java - 如何防止 spring-data-rest 中 relTargetType 的 json 输出?

我正在创建一个@RepositoryRestResource并将其导出为rest服务,如下所示:@RepositoryRestResource(collectionResourceRel="myContent",path="myContent")publicinterfaceMyContentRepositoryextendsPagingAndSortingRepository{}问题:当我请求内容时,我得到以下摘录:"content":[{"value":[],"rel":null,"collectionValue":true,"relTargetType":"com.domain.

java - 如何将具有 2 个实体名称的相同类迁移到 Spring Data JPA?

我正在将一个应用程序从Hibernate迁移到SpringDataJPA。我已经迁移了一些存储库并且可以正常工作。我现在有一个特殊情况需要转换。我的.hbm.xml中有这个:请注意我只有1个类SoundNotification,但它与2个不同的entity-name(SoundNotificationWithData和SoundNotificationWithoutData)一起使用是否可以将其转换为SpringDataJPA?我是否需要创建2个Java类作为“解决方法”?另一个例子是这个:..........在这里,我们在进行一些汇总计算后将相同的“Java对象”存储在不同的表中。我

java - 由于依赖项无效,无法加载类 org.eclipse.jdt.core.JDTCompilerAdapter

我正在创建一个java代理,用于对某些类进行一些字节码修改org.eclipse.jdt.core.JDTCompilerAdapter是其中之一。我正在使用javassit修改一些execute()org.eclipse.jdt.core.JDTCompilerAdapter的方法|.所以我在我的代理项目中包含了ecj(使用gradle)compilegroup:'org.eclipse.jdt.core.compiler',name:'ecj',version:'4.3.1'因为我需要使用ecj的一些类。代理的目标是拦截对execute方法的调用,修改execute方法以添加对我的

java - 在 Spring Data REST 中获取和更新延迟加载的许多字段

我如何正确公开延迟加载许多字段,以便用户可以GET/PATCH/POST/DELETESpringDataREST中的多对多实体关系?例如,给定一个Student实体和Teacher实体,它们由多对多关系绑定(bind),具有以下POJO:@EntitypublicclassTeacher{//ownerofbidirectionalrelationship@Idprivateintid;privateStringname;@ManyToMany(fetch=FetchType.LAZY)@JoinTable(name="teacher_student",joinColumns=@Jo

java - Spring data - 域对象继承和泛型方法

我有一些域对象:@EntitypublicclassLog{}@EntitypublicclassLogLetterextendsLog{}@EntitypublicclassLogActionextendsLog{}我只想拥有一个存储库,它允许我获取Log的子项。理论上我可以做这样的事情吗?publicinterfaceLogRepositoryextendsCrudRepository{@Query("selectfrom?1)publicListgetLog(Classclazz);}并调用这个方法:ListlogLetters=getLog(LogLetters.class);

java - 是否可以在 Spring Data JPA 中将 @Lock 与 @Modifying @Query 与 Hibernate 结合使用?

在将@Lock注释与@Modifying@Query一起使用以及查询本身执行更新语句时,我遇到了问题。我的测试设置如下所示:SpringBootStarter1.5.3.RELEASEhibernate5.2.10.FinalSpringDataJPA1.11.3.RELEASE测试的数据库:H2、PostgreSQL、MariaDB、Oracle示例实体:importjavax.persistence.Column;importjavax.persistence.Entity;importjavax.persistence.Id;importjavax.persistence.Tab

java - Spring Data JPA 无效的 page.sort 参数

在将SpringDataJPA与Hibernate结合使用的Web应用程序中,我们利用webpagination在各种实体列表中提供分页和排序功能的功能。@ControllerpublicclassMyEntityController{@RequestMapping(method=RequestMethod.GET)publicModelAndViewlist(Pageablepageable){...}}@ConfigurationpublicclassMyWebMvcConfigextendsWebMvcConfigurationSupport{@Overridepublicvoi

java - core 和 core_rt jSTL 标签的区别

当我使用时对于我的struts1.3.10项目,它抛出以下异常:org.apache.jasper.JasperException:Theabsoluteuri:http://java.sun.com/jsp/jstl/corecannotberesolvedineitherweb.xmlorthejarfilesdeployedwiththisapplicationorg.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)org.apache.jasper.compiler.

java - jackson 错误 : No such method com. fasterxml.jackson.core.JsonGenerator.setCurrentValue(Ljava/lang/Object;)V

我正在开发一个Spring-MVC应用程序,从早上开始,当我调用一个特定的Controller方法时,我收到了与Jackson相关的错误。由于没有具体指出错误所在的行,因此我查找并发现这是一个POM问题。我从周五开始才添加了Google和Dropbox依赖项,这个问题似乎正在发生。我已经尝试排除Jackson-mapper,但不走运。错误日志:SEVERE:Servlet.service()forservlet[appServlet]incontextwithpath[]threwexception[Handlerprocessingfailed;nestedexceptionisja