Comments (6)
I think this is a FAQ. There was another user with the same problem. Let me dig a little.
from spring-data-cassandra.
Here is the thread where I thought afterPropertiesSet
wasn't getting called: https://groups.google.com/d/msg/spring-data-cassandra/k2kkod-ZOkI/9X4NllmLbwMJ
I realize it's not necessarily the same as your problem.
Whether you're using XML or Java configuration, those methods should be getting called as part of the normal bean lifecycle. Can you fork, create a branch & repro in the branch so that I can see?
Also, have a look at the Java config-based tests.
from spring-data-cassandra.
I'm using Java configuration for my project. The project is, unfortunately, proprietary so I can't share it. I'm calling afterPropertiesSet()
after setting all my properties and things seem to work.
from spring-data-cassandra.
I can't seem to repro this. Can you create a test project that is configured as much like your proprietary one as possible and make it available on github somewhere please?
from spring-data-cassandra.
So, I am not having an issue with this per se. Things were working with or without calling afterProperties()
right now. My question is, should I generally make sure to call it? This is where I call them now: https://gist.github.com/JensRantil/f040e900edc8a2ee6192
from spring-data-cassandra.
In general, you should not call afterPropertiesSet()
manually. If you return a FactoryBean
from a @Bean
-annotated method, Spring will see that and ensure that afterPropertiesSet()
is called at the appropriate time during bean initialization. The only method that you sometimes need to call is FactoryBean#getObject()
, because the Spring Java Config code would not compile: you can't pass a FactoryBean
as an argument to something that takes some other type (the type of the object for which the FactoryBean
is a factory). In this case, you would have to call bean.getObject()
, where bean
is a reference to one of your factory beans.
For examples, see:
I did notice that CqlTemplate
was calling afterPropertiesSet()
in its constructor, which has since been fixed (as issue https://jira.spring.io/browse/DATACASS-152).
from spring-data-cassandra.
Related Issues (20)
- Release 4.1.8 (2023.0.8)
- Release 4.2.2 (2023.1.2)
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Datastax java-driver maven coordinates have changed HOT 1
- Release 4.1.9 (2023.0.9)
- Release 4.2.3 (2023.1.3)
- Constructor with `@Column`-annotated arguments leads to memory leak
- DTO projections causes the converter to be called twice
- Codec not found for requested operation using a `Set` of mapped User Defined Type HOT 3
- Documentation is out of date HOT 3
- Refine documentation
- Revise `@PrimaryKey` to be an alias for `@Column` HOT 1
- Add support for ValueExpression
- Release 4.1.10 (2023.0.10)
- Release 4.2.4 (2023.1.4)
- Release 4.3 M2 (2024.0.0)
- How do I add converter from Instant to org.joda.time.DateTime to spring-data-commons-3.2.1 and spring-data-cassandra-4.2.1 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-cassandra.