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

Js java object user request #458

Merged
merged 3 commits into from
May 26, 2024
Merged

Js java object user request #458

merged 3 commits into from
May 26, 2024

Conversation

ake2l
Copy link
Member

@ake2l ake2l commented May 26, 2024

I seem to get an error also during this instruction:
importPackage(com.rapiddweller.model.data);
Would there be another way of doing these imports inside the execute block? The error really that appears is that the first variable I have created, that "it has already been created". Seems unrelated.
If I remove the "importPackage" instruction, I don't have any error

He is following the 1.1.1 docs example: https://docs.benerator.de/1.1.0/scripting.html

<setup>
  <database id="db" url="jdbc:hsqldb:mem:example" driver="org.hsqldb.jdbcDriver" user="sa" schema="PUBLIC"/>

  <execute type="js">

  importPackage(com.rapiddweller.model.data);

  print('DB-URL' + db.getUrl());

  // create user Alice var alice = new Entity('db_user'); alice.set('id', 1); alice.set('name', 'Alice'); db.store(alice);

  // create user Bob var bob = new Entity('db_user', 'id', '2', 'name', 'Bob'); db.store(bob);

  // persist everything db.flush();

  </execute>
</setup>

@ake2l ake2l merged commit c78031d into development May 26, 2024
6 checks passed
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.

None yet

1 participant