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

Permission relationship #19

Merged
merged 5 commits into from
Apr 7, 2024
Merged

Permission relationship #19

merged 5 commits into from
Apr 7, 2024

Conversation

gerardmallol
Copy link
Contributor

relationship of the permission class


@Entity
@Setter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to use annotation getters and setters, If you use the annotation data

jorgechp
jorgechp previously approved these changes Mar 19, 2024
@jorgechp
Copy link
Contributor

PR OK. But there is a conflict that need to be solved before I can merge your code. Thanks!!

@Data
@EqualsAndHashCode(callSuper = false)
public class Permission {

@Id
@GeneratedValue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to make the generation method explicit to make sure it is unique, like: @GeneratedValue(strategy = GenerationType.IDENTITY)

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface PermissionRepository extends CrudRepository<Permission, String>, PagingAndSortingRepository<Permission, String> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If permission has Long as identifier, then the repository should use Long as identity type instead of String

@rogargon rogargon merged commit cbaed3a into main Apr 7, 2024
1 check 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.

4 participants