Open GoogleCodeExporter opened 8 years ago
1. Yes, it is. Because SSMCache is used when you use Cacheable Spring
annotation and there is no way to pass information about serialization. If you
use SSM annotations (ReadThroughMultiCache, ...) you can use
com.google.code.ssm.api.format.Serialization to specify serialization type.
There is a workaround for Spring Cache annotations, to use Spring annotations
and custom SSM serialization set CacheFactory.defaultSerializationType to
SerializationType.CUSTOM.
2. No exactly because you have to specify default serialization type: CUSTOM,
PROVIDER, JSON, ... and you can overwrite it at method level. It is not
possible to define that objects of one class will be used JSON and another
CUSTOM.
You should look at:
om.google.code.ssm.transcoders.JsonTranscoder and
com.google.code.ssm.mapper.JsonObjectMapper
it uses Jackson library for JSON serialization type. Using it you can define
how given class will be serialized. You may also want to read more about
Jackson's MixIn: http://wiki.fasterxml.com/JacksonMixInAnnotations, the library
provide a lot of great features while serializing/deserializing java objects.
3. If use use Spring Cacheable annotation then whole collection is stored under
single key and you have to provide serialization for Collection. The
com.google.code.ssm.mapper.JsonObjectMapper can again come in handy, it should
use default (jackson) mechanizm for serializing collection/list and your custom
for objects if dedicated JsonSerializer was registered.
Original comment by ragno...@gmail.com
on 3 Feb 2014 at 10:11
Do you need further assistance or everything is clear and I can close the issue?
BTW if you have some questions (not bug report or feature request) you may use
mailing list: simple-spring-memecached@googlegroups.com
Original comment by ragno...@gmail.com
on 6 Feb 2014 at 6:32
I implemented a hybrid solution by using JsonTranscoder and JavaTranscoder. I
will share details later.
Thank you so much for your awesome support.
Original comment by cemalettin.koc@gmail.com
on 6 Feb 2014 at 7:31
This issue has been moved to github:
https://github.com/ragnor/simple-spring-memcached/issues/27
Original comment by ragno...@gmail.com
on 24 Feb 2014 at 5:50
Original issue reported on code.google.com by
cemalettin.koc@gmail.com
on 3 Feb 2014 at 2:58