Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:34:52+00:00 2026-06-14T20:34:52+00:00

I’m using Play Framework 2.0 (Java), but after implementing a simple InitialData in Globals,

  • 0

I’m using Play Framework 2.0 (Java), but after implementing a simple InitialData in Globals, I’m having some problem.
I’m using

I have 2 models:

  • User(email as ID)
  • SomeModel(Long id as ID)

And SomeModel has a field like:

@ManyToOne
  public User user;

So in the and there is a User has many SomeModels connected to it.

In my InitialData I was adding a user to test somethings: test@test.com.

So if I try to add a SomeModel to this test user, I have no problem, even if I try to add more then one.

When I added the SomeModel(lets call a TestModel) in the InitialData I thought that there was no problem, since everything was running in this TestModel. But just now, I saw that if I try to add a new SomeModel to the test user, I get this problem:

[PersistenceException: ERROR executing DML bindLog[] error[Unique index or primary key violation: "PRIMARY_KEY_D ON PUBLIC.SOME_MODEL(ID)"; SQL statement:\n insert into some_model (id, name, description, user_email) values (?,?,?,?) [23505-158]]]

This is my InitialData file:

# Users

users:

    - !!models.User
        email:      test@test.com
        name:       Test test
        password:   test


# SomeModels
somemodels:

    - !!models.FuzzySystem
        id:       1
        name:       test
        description:   test
        user:       !!models.User
                            email: test@test.com

I’m lost in this =(

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:34:54+00:00Added an answer on June 14, 2026 at 8:34 pm

    So, I’ve just found out that the initialData shouldn’t have the ID of SomeModel…

    After removing the ID field everything worked just fine.

    This is how my initialData file is:

    # Users
    
    users:
    
        - !!models.User
            email:      test@test.com
            name:       Test test
            password:   test
    
    
    # SomeModels
    somemodels:
    
        - !!models.FuzzySystem
            name:       test
            description:   test
            user:       !!models.User
                                email: test@test.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.