Skip to content
This repository has been archived by the owner on Mar 2, 2019. It is now read-only.

An attempt to integrate a couple of interesting technologies that may not work together

Notifications You must be signed in to change notification settings

gilday/groovy-mixin-jpa-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Groovy Mixin persistent properties with JPA

This is a test project to demonstrate that a combination of technologies (hopefully) can work together

Problem

I want to use Groovy Mixins in my Groovy domain model classes in order to share functionality and properties between domain models. I would like JPA to persist properties of a domain model which were mixed in.

Test

I have a Mixin called "has preferences" which defines a JPA annotated collection of value objects of type Preference. I would like to Mixin the ability to have JPA persisted preferences in to several Groovy domain models like "Person". When I do this, JPA will not detect that the Person class has a collection called preferences.

To Run

Run the unit test which defines the behavior I would like to have mvn clean test

The test works because Person has a collection of Preference. Remove this collection from the Person class and uncomment the Groovy Mixin annotated on the Person class declaration. Run test again and see that it fails

About

An attempt to integrate a couple of interesting technologies that may not work together

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages