Search Results

Search found 3 results on 1 pages for 'homaxto'.

Page 1/1 | 1 

  • Deleting orphans with JPA

    - by homaxto
    I have a one-to-one relation where I use CascadeType.PERSIST. This has over time build up a huge amount of child records that has not been deleted, to such an extend that it is reflected in the performance. Now I wish to add some code that cleans up the database removing all the child records that are not referenced by a parent. At the moment we are talking 400K+ records, at I need to run the code on all customer installations just to be sure they do not run into the same problem. I think the best solution would be to run a named query (because we support two databases) that deletes the necessary records, and this is where I get into problems, because how should I write it in JPQL? The result I want can be defined like the following sql statement, which unfortunaltely does not run on MySQL. DELETE FROM child c1 WHERE c1.pk NOT IN (SELECT DISTINCT p.pk FROM child c2 JOIN parent p ON p.child = c2.pk);

    Read the article

  • Unique constraint not created in JPA

    - by homaxto
    I have created the following entity bean, and specified two columns as being unique. Now my problem is that the table is created without the unique constraint, and no errors in the log. Does anyone have an idea? @Entity @Table(name = "cm_blockList", uniqueConstraints = @UniqueConstraint(columnNames = {"terminal", "blockType"})) public class BlockList { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @ManyToOne(cascade = CascadeType.PERSIST) @JoinColumn(name="terminal") private Terminal terminal; @Enumerated(EnumType.STRING) private BlockType blockType; private String regEx; }

    Read the article

  • A lot to merge after creating a new branch in SVN

    - by homaxto
    We have recently made a new branch, let us call it rel3.6, which was based on the last release named rel3.5. Work has started on rel3.6, and meanwhile some bugs has been fixed on rel3.5 which now is used for a service pack to be released soon. Today I wanted to merge those bugs from rel3.5 to rel3.6, so I fired up SmartSVN. Standing in the rel3.6 branch i chosed\ to merge with rel3.5 and selected to browse for a revision range. To my surprise there was a huge list of changes even though I checked "Stop on copy" and only showing mergeable revisions. Most of them where dated back before the creation of rel3.6. I did not expect to find anything from before rel3.5 was created. If I make a merge, the only thing I get are changes and conflicts to directory properties. Have I misunderstood something, or is it possible that something was done wrong when creating the branch?

    Read the article

1