Hi Alex,
Thanks for your question. You have 2 solutions for your need.
1) if you have to do this once you can create your own OAuthSettings and produces it with the right Service qualifier like this
@ApplicationScoped
@Twitter
@Produces
public OAuthAppsettings producesTwitterSettings() {
OAuthAppsettings mySettings;
//Do your JPA stuff here to build the OAuthAppSettings,
return mySettings;
}
2) If you want a reusable solution, you can implements the OAuthAppsettingsBuilder to create a JpaOauthAppsettingsBuilder.
When it’s done you can use it your producer method or let Agorava extension do the job for you by using @OAuthApplication annotation:
@ApplicationScoped
@Twitter
@Produces
@OAuthApplication(builder = OAuthAppSettingsBuilder.class,params = {@Param(name = "pu", value = "myPersisitenceUnit")})
public OAuthAppSettings produceSettings;
Params are optional in the annotation off course.
Antoine Sabot-Durand
———————————————
Twitter : @antoine_sd
CDI co-spec lead & eco-system development
Agorava tech lead