AnsweredAssumed Answered

BbServiceManager.getPersistenceService() is deprecated. Replaced with what?

Question asked by cc0049362 on Nov 2, 2016

The following code snippet is giving warnings because BbServiceManager.getPersistenceService() is deprecated. What should I be using instead? Does the snippet need to be totally reworked with the newer code?

 

BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();

 

Content content = new Content();

content.setTitle(title);

FormattedText text = new FormattedText("...", FormattedText.Type.HTML );

content.setBody(text);

content.setContentHandler("resource/x-testout_course");

 

Id courseId = bbPm.generateId(Course.DATA_TYPE, course_id);

Id parentId = bbPm.generateId(Content.DATA_TYPE, parent_id);

content.setCourseId(courseId);

content.setParentId(parentId);

 

ContentDbPersister persister = (ContentDbPersister)bbPm.getPersister(ContentDbPersister.TYPE);

persister.persist(content);

Outcomes