Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors when Orienteer was reload #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix errors when Orienteer was reload #2

wants to merge 4 commits into from

Conversation

vitalii-honchar
Copy link
Member

No description provided.

@@ -39,7 +39,7 @@ protected Object execute(ODatabaseDocument db) {
private static void createClassCache(ODatabaseDocument db) {
classCache = new HashMap<>();
for (OClass oClass : db.getMetadata().getSchema().getClasses()) {
if (OTelegramModule.TELEGRAM_SEARCH.getValue(oClass)) {
if (OTelegramCustomAttributes.TELEGRAM_SEARCH.getOrCreate().getValue(oClass)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we discussed that I thought that you will use CustomAttributes and add "getOrCreate()" method there instead of creating separate class OTelegramCustomAttributes. Any problems with dynamic loading in that case? If no - lets get rid of OTelegramCustomAttributes.

propertiesList.add(OTelegramCustomAttributes.TELEGRAM_SEARCH.getOrCreate().getName());
propertiesList.add(OTelegramCustomAttributes.TELEGRAM_DOCUMENTS_LIST.getOrCreate().getName());
propertiesList.add(OTelegramCustomAttributes.TELEGRAM_CLASS_DESCRIPTION.getOrCreate().getName());
propertiesList.add(OTelegramCustomAttributes.TELEGRAM_SEARCH_QUERY.getOrCreate().getName());
structureTable = new OrienteerStructureTable<OClass, String>("attributes", model, propertiesList) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically you can use CustomAttribute instead of String here.

/**
* @author Vitaliy Gonchar
*/
public enum OTelegramCustomAttributes {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented below. It seems to be quite dummy file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants