Skip to content

How to create primary key with two fields? #13

@fechidal89

Description

@fechidal89

I have this model:
private long userId;
private long recipeId;
private int Score;
private int Favorites;
private int Followers;

I want that userId and recipeId be my primary key for insert or replace an object.

can I use a composite primary key? -> http://www.objectdb.com/java/jpa/entity/id#Composite_Primary_Key_

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions