Package org.apache.openejb.test.entity.cmr.onetomany

Examples of org.apache.openejb.test.entity.cmr.onetomany.SongLocal


    public void test03_BSetADropExisting() throws Exception {
        resetDB();
        beginTransaction();
        try {
            SongLocal song = findSong(11);
            song.setPerformer(null);
            song = findSong(22);
            song.setPerformer(null);
        } finally {
            completeTransaction();
        }

        assertUnlinked(1);
View Full Code Here


    public void test04_ASetBNewAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(22);
            Set<SongLocal> songSets = new HashSet<SongLocal>();
            songSets.add(song);
            artist.setPerformed(songSets);
        } finally {
            completeTransaction();
View Full Code Here

    public void test05_BSetANewAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(22);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }
        assertLinked(2, 22);
    }
View Full Code Here

    public void test06_ASetBExistingBNewA() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(11);
            Set<SongLocal> songSets = artist.getPerformed();
            songSets.add(song);
        } finally {
            completeTransaction();
        }
View Full Code Here

    public void test07_BSetAExistingBNewA() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(11);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }

        assertLinked(2, 11);
View Full Code Here

    public void test08_ASetBExistingANewB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            SongLocal song = createSong(33);
            Set<SongLocal> songSets = artist.getPerformed();
            songSets.add(song);
        } finally {
            completeTransaction();
        }
View Full Code Here

    public void test09_BSetAExistingANewB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            SongLocal song = createSong(33);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }

        assertLinked(1, 11, 22, 33);
View Full Code Here

    public void test10_RemoveRelationships() throws Exception {
        resetDB();
        beginTransaction();
        try {
            SongLocal song = findSong(11);
            ArtistLocal artist = song.getPerformer();
            Set<SongLocal> songs = artist.getPerformed();
            assertTrue(songs.contains(song));
            song.remove();
            assertFalse(songs.contains(song));
        } finally {
            completeTransaction();
        }
        assertLinked(1, 22);
View Full Code Here

    // uncomment when cmp to cmr is supported
    public void TODO_testCMPMappedToForeignKeyColumn() throws Exception {
        resetDB();
        beginTransaction();
        try {
            SongLocal song = findSong(11);

            Integer field3 = song.getBpm();
            assertEquals(song.getPerformer().getPrimaryKey(), field3);
        } finally {
            completeTransaction();
        }
    }
View Full Code Here

    // uncomment when cmp to cmr is supported
    public void TODO_testSetCMPMappedToForeignKeyColumn() throws Exception {
        resetDB();
        beginTransaction();
        try {
            SongLocal song = findSong(11);

            song.setBpm(2);

            ArtistLocal artist = song.getPerformer();
            assertEquals(new Integer(2), artist.getId());
            assertEquals("value2", artist.getName());
        } finally {
            completeTransaction();
        }
View Full Code Here

TOP

Related Classes of org.apache.openejb.test.entity.cmr.onetomany.SongLocal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.