on 02-13-2017 8:04 PM
Hi Experts,
We are working on updating the huge amount of records into Hybris database from the third party rest services for this , we would like to use ServiceLayer Direct for faster updation, but we could not find proper documentation for how to implement this business logic. From wiki i could find only a link but it is saying limitation and approach, but there is no usage documentation , could some one please help me.
Exactly, it all happens down under in the platform. When you call modelService.save() hybris will automatically use SLD logic to store things.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopi,
When you update any records in Hybris data base , usually any data persistence should happen in DAO layer. and which is Hybris design pattern and as Marko said you do not implement any thing special when you updating or modifying records in database. Your service layer trigger , Facade layer , and then DAO layer where you can implement all you data base flexible search queries
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually you don't implement anything special, it is all handled in the persistence layer. Just activated it by setting property persistence.legacy.mode to false.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for quick response .
But my requirement is to create the records for the first time and from the second time i should update the same record in the database using this approach. Could share me the code base for doing this.
Will the following code do the above functionality
**PersistenceUtils.doWithSLDPersistence(() -> { final TitleModel title = modelService.create(TitleModel.class); title.setCode("foo"); modelService.save(title);
return title;
});**
Thank you for quick response .
But my requirement is to create the records for the first time and from the second time i should update the same record in the database using this approach. Could share me the code base for doing this.
Will the following code do the above functionality
**PersistenceUtils.doWithSLDPersistence(() -> { final TitleModel title = modelService.create(TitleModel.class); title.setCode("foo"); modelService.save(title);
return title;
});**
Thank you
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.