delete

Hibernate: How to delete child records instead of setting foreign key to null

I have a User and a set of Authorities in a one-to-many relationship: User.hbm.xml: <set name="authorities" table="authorities" cascade="all-delete-orphan"> <key column="user_id" /> <one-to-many class="com.ebisent.domain.Authority" /> </set> When I delete a user, I want to delete the authorities as well, but what is happening...

Netbeans / Java / Delete Files on Mac

I have a problem with my Java program. I want to delete a file on my hdd; I use a MacBook. Here is my code: public static void main(String[] args) { File actualFile = new File("/Users/luffy/test.xml"); actualFile.delete(); } chmod is set! Help please. ...

NSMutableArray vs. NSDictionary for a table view

I have a table view that is populated by objects in an array. I want to give the user the option to delete table entries. I was wondering if it would be easier if I used NSDictionary instead of NSMutableArray? How do you know when to use NSDictionary instead of NSMutableArray? ...

iphone SDK:How to use the checkmark to delete the row is checked ???

hello everyone I only know the first step is to check a row next I think is use a NSMutableArray to record which row is been checked and this is my code : - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if ([[tableView cellForRowAtIndexPath:indexPath] accessoryType] == UITableView...

Is there a good utility / 3rd party library to manage the AppEngine datastore?

I have been developing an app using appengine. We are likely to be storing a lot of records in the datastore but I find the admin functionality you are given to manage this data lacking. As an example, there are no good ways to bulk delete a bunch of data - you have to write a class of your own to do this. Before I start down the path...

Why can't files in my iPhone NSBundle folder be deleted?

I'm having trouble figuring out why files in my iPhone app seem to persist, even when I've deleted them. Here's the code that's giving me trouble: NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; NSString *folderPath = [bundlePath stringByAppendingPathComponent:@"fi...

delete with join in Zend-Framework

This're my tables: To update a document I need to delete all functions. What is the best approach to do this in ZendFramework? Is there a solution using delete and join? ...

Deleting objects from template list

Hi All, I have a template list say, List<SuperClass*>* mList; for(int i = 0;i < mList->ElementsCount();i++) mList->DeleteElementAtIndex(i); in mList objects of subclasses are added. while on deleting object from the list, should i need to convert the object into corresponding subclasses and call delete method ...

HttpDelete with body

I'm attempting to use an HttpDelete object to invoke a web service's delete method. The web service's code parses JSON from the message's body. However, I'm failing to understand how to add a body to an HttpDelete object. Is there a way to do this? With HttpPut and HttpPost, I call the setEntity method and pass in my JSON. There doe...

How do I mark a directory to be deleted after reboot?

I've got an uninstaller that performs some actions and then prompts the user to reboot. I'd like a directory to be deleted after the reboot takes place. I know there's a way to do this, I'm just not sure how. I'm using a WiX installer, and I'd imagine I could use that to do so, somehow, but I'm open to alternatives (whatever's simplest ...

I got error "The DELETE statement conflicted with the REFERENCE constraint"

Hello, I have a big problem :) I try to truncate table with foreign keys and I got the message "Cannot truncate table because it is being referenced by a FOREIGN KEY constraint". I read a lot literature about the problem and thought that I found the solution by using delete (e.g. DELETE FROM table_name DBCC CHECKIDENT (table_name, RESEE...

DataRow which is added is not going to be delete doing table.Rows[i].Delete() ?

Why is that? The state of the datarow is added. When I delete the row the state is unchanged. Why not deleted? Thats the reason my Delete Store Procedure is never called! edit: the datarow is freshly added and then I try to delete it. ...

How to delete a template?

i'm having truble with deleting my template my template and distructor : template<class S, class T> class Consortium { private : map<const S, Node<T>*> m_consortiumMap; Heap<T>m_consortiumHeap; public : ~Consortium(); void Insert(const S key, T toAdd); void Update(const S key); void Remove(const S key); ...

Why is this vector iterator not incrementable?

i'm trying to delete the vector's content and i'm getting an error - vector iterator is not incrementable, why is that? this is my destructor City::~City() { vector <Base*>::iterator deleteIterator; for (deleteIterator = m_basesVector.begin() ; deleteIterator != m_basesVector.end() ; deleteIterator++) m_basesVector....

Hibernate ConstraintViolationException when cascading delete on @OneToMany

Hello, This may seem like a very simple question, but I have been struggling with it for a while. I have two entities Client and User where Client is a parent of User. The entities are annotated as follows: Client: @OneToMany(mappedBy = "client", fetch = FetchType.LAZY) @Cascade({CascadeType.SAVE_UPDATE, CascadeType.DELETE}) ...

Removing node using xquery

Hi, I am trying to remove a child node from a parent node using xquery. Say, I have an entry shown below in my xml: <entry> <id>36</id> <title>Engineering Village Author Tool</title> <updated>2009-09-30T12:55:42Z</updated> <libx:libapp> <libx:entry xmlns:libx="http://libx.org/xml/libx2" src...

how cut the mercurial repository from certain revision / push

I have broken some code in my last 4-5 revisions / pushes to main repository. At now I want to completely delete this pushes and start HEAD of my repository from that point. How can I do that? In SVN there is dump command, which copies whole repository from one revision to another. There is some substitute in Mercurial or oher way? ...

Deleting object from a stack.

Is it bad/illegal C++ to delete manually objects from a stack or there are situation when it is acceptable? Edit Constructor(pointer parent, pointer left, pointer right):parent_(parent),left_(left), right_(right) { } ~Constructor() { delete parent_; delete left_; delete right_; } main()...

Garbage Collection and JavaScript "delete": Is this overkill/obfuscation, or a good practice?

I just read this question and the accepted answer: http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection In the answer, Noldorin referenced some guidelines from apple. Here is the part I'm concerned with: Use delete statements. Whenever you create an object using a new statement, pair it with a delete sta...

How do I remove elements at a set of indices in a vector in MATLAB?

I have a vector with 100 elements. I have another vector with index positions of elements I want to remove from this vector. How do I do this? ...