spring-content icon indicating copy to clipboard operation
spring-content copied to clipboard

spring-content without annotations on entities?

Open stefan-ka opened this issue 4 years ago • 4 comments

Hi there

I'm evaluating whether I can use spring-content to store our entity-related blobs on a file system (we use Spring Data JPA to persist our entities). As far as I can see, it seems to be the perfect fit; however, we do not use spring's annotations on our entities, as we want to keep them free from any external dependencies. Instead of using spring's annotations, we configure the entities in the META-INF/orm.xml file. For that reason, we also don't want to add @ContentId and @ContentLength annotations to our entities.

Is there any way to use spring-content without annotations on the entities? Is it possible to configure it in a config file, similar to Spring Data JPA?

Thanks for your help! Stefan

stefan-ka avatar Sep 16 '21 15:09 stefan-ka

I assume the answer is "no" then, right @paulcwarren.?

stefan-ka avatar Sep 20 '21 11:09 stefan-ka

Hi @stefan-ka, apologies for the tardy response times. The answer is no I am afraid. Spring Content doesn't support this at the moment. I try and run the project in as community driven way as possible though so I would be happy to work with you to add that functionality?

paulcwarren avatar Sep 20 '21 15:09 paulcwarren

Hi @paulcwarren

Thanks for the answer!

I would be happy to contribute to the project; however, for my current project I will have to search for another solution or workaround as we cannot wait for the feature (time pressure).

stefan-ka avatar Sep 21 '21 12:09 stefan-ka

No problem. For a few reasons I am in the process of refactoring the code to add something akin to the MappingContext in Spring Data but for the content attributes so that would be the place to add this, I suspect. Basically, a layer that knows all of the spring content attributes (and treats them as sets). We could add a second loading strategy to read an external file. But that isn't going to get done overnight I am afraid.

paulcwarren avatar Sep 21 '21 15:09 paulcwarren