I have an Entity called `Artwork` which has a member called subjects mapped Many to Many with another entity as follows.

```
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private List<ArtSubject> subjects;

```

Assume that in my `Artwork` table i have a record with subjects values as `(ArtSubject1, ArtSubject2, ArtSubject3)`

I have to replace this value with `(ArtSubject5, ArtSubject6, ArtSubject7)`. 

Completely different List. 

Curretly if i save an `Artwork` object with new data as `(ArtSubject5, ArtSUbject6, ArtSubject7)`. 

JPA appends it with the already existing list and the resulting data is `(ArtSubject1, ArtSubject2, ArtSubject3, ArtSubject5, ArtSUbject6, ArtSubject7)`

I want it to be only `(ArtSubject5, ArtSubject6, ArtSubject7)`

Please find the method where i save the ArtSubject and set it to the Artwork object. 

```
ArtWork artwork = new ArtWork();
        List<ArtSubject> subject = new ArrayList<>();
        List<ArtStyle> style = new ArrayList<>();
        Artist artist = new Artist();
        List<ArtCollection> artCollections = new ArrayList<>();

        // Classifying Collections into each category.
        for (Collection collection : collections) {
            String tokens[] = collection.getTitle().split("_");
            if (tokens == null || tokens.length < 2) {
                LOGGER.info("Invalid Collection Type: Collection type {} not recognised", 
                        collection.getTitle());
                continue;
            }
            String collectionType = tokens[0]; 
            switch(collectionType) {
            case "subject":
                ArtSubject artSubject = new ArtSubject(collection.getId(), 
                        collection.getTitle().split("_")[1]);
                subject.add(artSubject);
                artSubjectRepository.save(artSubject);
                break;
            default:
                LOGGER.info("Invalid Collection Type: Collection type {} not recognised", 
                        collection.getTitle());
                break;
            }
        }

        artwork.setSubject(subject);

```

After this i save the artwork as artRepository(CRUD Repository) `artRepository.save(artwork)`
Please help me with this.

Thanks in advance!