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

Do not add @SystemLevel attributes when generating components #308

Open
IskandarovRost opened this issue Aug 27, 2020 · 0 comments
Open
Labels
enhancement New feature or request generator: React

Comments

@IskandarovRost
Copy link

CUBA Platform version: 7.2.7
CUBA Studio plugin version: 14.0.SNAPSHOT2510-202
IntelliJ version: IntelliJ IDEA 2020.2 (Community Edition)
Frontend generator 3.1.1

There is an ability to link entities from different datastores in Platform, and it is also supported by Studio
See the documentation: https://doc.cuba-platform.com/manual-latest/data_store.html#cross_datastore_ref

  1. Create an additional datastore in Studio
cuba.additionalStores=pgAds,

cuba.persistenceConfig_pgAds=+com/company/adstest2708/pgAds-persistence.xml
  1. Create "MainEnt" in the main datastore
@Table(name = "ADSTEST2708_MAIN_ENT")
@Entity(name = "adstest2708_MainEnt")
public class MainEnt extends StandardEntity {
    private static final long serialVersionUID = 2071190532239818500L;

    @Column(name = "ME_FLD")
    private String meFld;
 ...
    }
}
  1. Create "AdditionalEntity" in the second datastore
  2. Add a link to "MainEnt" (the entity from the first datastore)
    See Studio generated the attribute which is 'SystemLevel' @SystemLevel @Column(name = "MY_MAIN_ID") private UUID myMainId;
@Table(name = "ADSTEST2708_ADDITIONAL_ENTITY")
@Entity(name = "adstest2708_AdditionalEntity")
public class AdditionalEntity extends StandardEntity {
    private static final long serialVersionUID = 7284383439194045433L;

    @Column(name = "AE_FLD")
    private String aeFld;

    @SystemLevel
    @Column(name = "MY_MAIN_ID")
    private UUID myMainId;

    @Transient
    @MetaProperty(related = "myMainId")
    private MainEnt myMain;
  1. Create Front module
    See the UUID attribute definition in projectModel.json
"name":"myMainId","type":{"packageName":"java.util","className":"UUID","fqn":"java.util.UUID","label":"UUID"},"mappingType":"DATATYPE","readOnly":false,"column":"MY_MAIN_ID","mandatory":false,"unique":false,"length":"255","transient":false}
  1. Generate CRUD-Components for both the entities

  2. Start the application

  3. Open Additional entity editor

AR: the UUID @systemlevel field is presented
image.png
When a new instance is created and a linked entity is selected the UUID field is empty - it is not auto-filled immediately only on the instance saving: It looks not so pretty

image.png

ER:
Vaadin UI (Generated by Studio) does not show this field at all neither in browser nor in the editor
image.png
image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generator: React
Projects
None yet
Development

No branches or pull requests

1 participant