Custom data store - Studio v1.2 issue

Hi,

I am creating custom data store (for handling of DTO entities) according to the documentation:
https://docs.jmix.io/jmix/data-model/data-stores.html#custom

  1. Created data store implementation itself:
@Component("microstreamDataStore")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class MicrostreamDataStore implements DataStore {
    ...
}
  1. Created data store descriptor implementation:
@Component("microstreamDataStoreDescriptor")
public class MicrostreamDataStoreDescriptor implements StoreDescriptor {
    @Override
    public String getBeanName() {
        return "microstreamDataStore";
    }

    @Override
    public boolean isJpa() {
        return false;
    }
}
  1. Added application property:
    jmix.core.additional-stores = microstream

  2. Added application property:
    jmix.core.store-descriptor_microstream = microstreamDataStoreDescriptor

  3. Added @Store annotation to the DTO entity (in Text mode of entity designer in Studio):

@Store(name = "microstream")
@JmixEntity
public class Tick {
    @JmixGeneratedValue
    @JmixId
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
  1. And now is interesting point. If I am switching from Text to Designer mode in entity designer and back, the entity looks like that (name attribute of the @Store annotation is removed):
@Store
@JmixEntity
public class Tick {
    @JmixGeneratedValue
    @JmixId
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
  1. If I do the switching again, the entity looks like that (the @Store annotation is removed completely):
@JmixEntity
public class Tick {
    @JmixGeneratedValue
    @JmixId
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}

Should it be considered as Studio bug (I am using the version 1.2) and if yes, is there any workaround for that?

Thank you.

Hi!

Thanks for reporting the problem. We have created an issue and will try to fix it soon.

Best regards,
Irina

Hi! Thanks for creating the issue. What would you estimate how soon it could be solved and available to download?

This fix will most likely be included in the next patch-release and will be available in one or two weeks

1 Like