Delete entity that participate in many to many association

Hi all,
I have two tables related by a many to many relationship (for ex department and employee).
So I have three tables:
Department: table of departments
Employee: table employees
deptEmp: the association table relating the employees to the departments.
When a department is deleted, all the corresponding rows in deptEmp table should also be deleted (and same for employee).
On the entity level, I have created the many to many association (between department and employee) and a one to many association for each of department and employee entities to deptEmp entity (deptEmptAssoc from department to deptEmp and empDeptAssoc employee  to deptEmp).
I configured the deptEmptAssoc association to be a composition and implement the cascading delete, and it is working fine. When I delete a department, the corresponding rows in deptEmp are deleted.
The problem is that when I try to do the same for empDeptAssoc, JDev gives me a warning and doesn’t apply the composition neither the cascading delete.
I tried to override the remove method of employee entity to also remove the corresponding deptEmp but it also didn’t work.
So any hint or pointer how to achieve this? How to have a many to many association and be able to delete both sides of the association?
Thank you.

Hi,
This behavior can be done by overriding the postChanges method as follow:
  public void postChanges(TransactionEvent transactionEvent) {
        if(getPostState() == STATUS_DELETED){
            RowIterator mmIterator = getMM();
            while (mmIterator.hasNext()){
                EntityImpl row = (EntityImpl)mmIterator.next();
                row.remove();
row.postChanges(transactionEvent);
        super.postChanges(transactionEvent);
N.B.1  In the xml file of the viewLink, the composition association (and implement cascade delete) should not be checked.
N.B.2  with these flags unchecked, ADF will not control the posting of entities in case the department and the deptEmp entities were both newly created. To fix the issue, the deptEmp entity should also override the postChanges method as follow:
                    public void postChanges(TransactionEvent transactionEvent) {
        if (getPostState() == STATUS_NEW ||
              getPostState() == STATUS_MODIFIED) {
            EntityImpl dept = getDept();
            if (dept != null) {
              if (dept.getPostState() == STATUS_NEW) {
dept.postChanges(transactionEvent);
                                                // do the same for the Employee entity if needed
        super.postChanges(transactionEvent);
Regards.

Similar Messages

  • My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Help!

    My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Please help !!!!

    Thank you very much for your reply gdgmacguy :) I did all you suggested apart from restore as new device . Didn't know I could do that . After restore I did restore from back up only,  as I didn't want to end up without contacts details on my phone. If I restore as new device how do I get my all contacts? Still will have to use back up? Sorry if it sounds like I don't know what i am doing, i just have no one to ask who would know. Thank you

  • How to move an object that is in many layers in to its own layer?

    Hello,
    I created a catalog where I have used layers but at that time didn't know that I will be creating another catalog of the same products for our wholesalers.  Anyway, now I have an object (QR Code) that is in many layers and I need to move it to its own layer where I can turn it on or off as needed. I have already created the layer but now I am not sure the quickest way to move the (QR code). I really need to learn how to use GREP in find and change, I sure it is possible with GREP but don't know the string to use.
    I would appreciate any kind of help I can get.
    Thanks,
    Omar

    Am I crazy, or is there a "Paste Remembers Layers" checkbox hidden somewhere in the preferences? Because when I have a bunch of objects that are all on separate layers, I simply Copy, Delete, and Paste in Place - and then they're all on one layer.
    I'm not crazy! It's in the options on the Layers panel. And it seems to be off by default.

  • Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Sorry but I know of no way of not backing up for a PC.

  • I am not able to use my apple id on my phone it show that there are many free user on this iphone plzz helpe out of this

    I am not able to use my apple id on my phone it show that there are many free user on this iphone plzz helpe out of this

    Where did you get the iPhone?
    What many free user are you talking about?

  • I have itune on my first computer, but i cant download it for my other one,how can i do that, i tryed many time with the link it says you download it but nothing follows  thank you

    I have itune on my first computer, but i cant download it for my other one, how can i do that, i tryed many time with the link it says you download it but nothing follows  thank you

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • When I tap on Top 25 button for the app store I get a window that says "to many HTTP redirects" it also happens when I tap on the categories button

    When I tap on Top 25 button for the app store I get a window that says "to many HTTP redirects" it also happens when I tap on the categories button

    Restart your device
    Reset All Settings (Settings > General > Reset)
    Backup and Restore
    Do all of those in order - although I almost guarantee you won't need to perform the last step.
    Sounds like your phone is just getting a resource error.

  • HT204406 I downloaded a song that is not playing.  When i click to report a problem it gives me an error that says "To many HTTP redirects".  What does this mean and how do I fix it?  Thank you!

    I downloaded a song that is not playing.  When i click to report a problem it gives me an error that says "To many HTTP redirects".  What does this mean and how do I fix it?  Thank you!

    The following support articles should help:
    * https://support.mozilla.com/kb/Could+not+initialize+the+browser+security+component
    * https://support.mozilla.com/kb/AUS+Update+XML+File+Malformed+200

  • Hi, I want to know if in the AppStore exist an app that count how many messages I have been used. Thanks

    Hi, I want to know if in the AppStore exist an app that count how many messages I have been used

    Some carriers have iOS apps that will tell you this info...see if yours does, or can't you just login to your account online & see such info?

  • HT4993 i keep getting a msg that says "too many http redirects" why is that? and how do i  fix it?

    i was trying to watch a movie in itunes andd i keep getting a msg that says "too many http redirects" and i need help fixing it so i can watch my movies!!!!!!!!!!!!!!!

    This has been asked and answered several times today.
    Look at the other posts below yours or look at the Morew Like This section on the right side of this page or do a forum search, also on the right side of this page.

  • HT2534 If only it were that simple. Many of us have no "none" available.  Since the guy on the other discussion clearly had no desire to help anyone, I thought I'd ask here instead... can anyone help with this?

    If only it were that simple. Many of us have no "none" available.
    Since the guy on the other discussion clearly had no desire to help anyone, I thought I'd ask here instead... can anyone help with this?

    Open iTunes and navigate to the app store. Select a free app to download. A simple way to do this is to scroll down to the top free apps box on the right hand side, hover your mouse over the first item and click on the free button that appears when you hover over it.
    A pop up will open asking you to sign in with your Apple ID click "create new account", click continue to create your account. Check the box to accept the store terms and conditions and click continue.
    Enter your email address, password, security question, and date of birth, click continue. Now, you will be asked to provide a payment method. Note now that the last option says "none".

  • Is there a way to set an email mailbox so that mail from many months are stored, but the general default for the other mailboxes is a few days?

    Is there a way to set an email mailbox so that mail from many months are stored, but the general default for the other mailboxes is a few days?

    The only thing I can think of is to set the number of days to sync messages, shown below. But I'm not sure if this is what you're after. If it is go to Settings > Mail, Contacts, Calendars select the email account you wish to change.
    This will then only sync emails from the last week for example. In the screenshot all email messages would be synced to the iPhone.
    Message was edited by: Michael Bratley

  • Having switched from iPhoto to ICloud Photo I find that their are many, many double and triple photos. Just added a small folder of photoes and all are showing in photos as doubles. What am I doing wrong?

    Having switched from iPhoto to ICloud Photo I find that their are many, many double and triple photos. Just added a small folder of photoes and all are showing in photos as doubles. What am I doing wrong?

    Martin,
    I am not sure, however you may want to post in the Photos forum, please click Photos for Mac to get there.

  • Adding/removing many-to-many associations with intersection tables

    Hello,
    I am using Jdeveloper 11g with ADFBC.
    I have some many to many associations in my application. For example User and Category are associated and there is an intersection entity (UserCategory - Columns are UserId, CategoryId) to save these associations.
    What is the correct method for adding or removing categories assigned to user?
    Thanks.
    Edited by: Deniz Gulmez on 01-Nov-2009 03:25

    I found an example for Jdeveloper 10g, which is discussed [ADF] Adding/deleting entries in a many-to-many relationship
    In that example, many-to-many association is defined as two 1-to-many associations. Actually i've been searching since last week for an example which is made with many-to-many associations but no help. I will change my Model structure if it is not an efficient way to define many-to-many associations with intersection tables.
    I wonder if it is possible to write some methods like :
    addCategoryToUser(String userId, String categoryId)
    removeCategoryToUser(String userId, String categoryId)
    addCategories(String userId, List categoryIds)
    vs.
    Of course i am able to do these by creating a new Row in UserCategoryView (Intersection view), setting it's attributes and saving. Or the opposite, finding the row in intersection table and deleting it.
    For example:
    public void removeCategoryFromUser(String userId, String categoryId){
    ViewObjectImpl vo = this.getUserCategories1();
    vo.setWhereClause("USER_ID = :userId AND CATEGORY_ID = :categoryId");
    vo.defineNamedWhereClauseParam("userId", null, null);
    vo.defineNamedWhereClauseParam("categoryId", null, null);
    vo.setNamedWhereClauseParam("userId", userId);
    vo.setNamedWhereClauseParam("categoryId", categoryId);
    vo.executeQuery();
    Row row = vo.first();
    row.remove();
    I wonder if there is a more efficient way. Any samples would be appreciated.
    Edited by: Deniz Gulmez on 01-Nov-2009 05:49

  • Can I delete extensions that do not load or am I looking for trouble

    After running EtreCheck I noticed that many extensions do not load.  So my question is: Can I delete extensions that do not load or am I looking for trouble?
    Here is the EtreCheck report:
    Problem description:
    slow with Yosemite
    EtreCheck version: 2.1.8 (121)
    Report generated February 19, 2015 at 12:11:22 PM EST
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        Mac Pro (Late 2013) (Technical Specifications)
        Mac Pro - model: MacPro6,1
        1 3 GHz 8-Core Intel Xeon E5 CPU: 8-core
        32 GB RAM Upgradeable
            DIMM1
                8 GB DDR3 ECC 1866 MHz ok
            DIMM2
                8 GB DDR3 ECC 1866 MHz ok
            DIMM3
                8 GB DDR3 ECC 1866 MHz ok
            DIMM4
                8 GB DDR3 ECC 1866 MHz ok
        Bluetooth: Good - Handoff/Airdrop2 supported
        Wireless:  en2: 802.11 a/b/g/n/ac
    Video Information: ℹ️
        AMD FirePro D500 - VRAM: 3072 MB
        AMD FirePro D500 - VRAM: 3072 MB
            Thunderbolt Display 2048 x 1152
            Thunderbolt Display 2048 x 1152
    System Software: ℹ️
        OS X 10.10.2 (14C109) - Time since boot: 2:10:13
    Disk Information: ℹ️
        APPLE SSD SM1024F disk0 : (1 TB)
            EFI (disk0s1) <not mounted> : 210 MB
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk1) / : 999.32 GB (760.04 GB free)
                Core Storage: disk0s2 999.70 GB Online
    USB Information: ℹ️
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
        American Power Conversion Smart-UPS 3000 XL FW:691.18.D USB FW:7.3
        Prolific Technology Inc. USB-SATA Bridge
        Apple Inc. Display Audio
        Apple Inc. FaceTime HD Camera (Display)
        Apple Inc. Apple Thunderbolt Display
        Apple, Inc. Keyboard Hub
            Apple Inc. Apple Keyboard
        Apple Inc. FaceTime HD Camera (Display)
        Apple Inc. Apple Thunderbolt Display
        Apple Inc. Display Audio
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus_2
            Apple Inc. Thunderbolt Display
        Apple Inc. thunderbolt_bus_1
        Apple Inc. thunderbolt_bus_0
            Promise Technology, Inc. Pegasus2-R
                Drobo 5D
            Apple Inc. Thunderbolt Display
    Configuration files: ℹ️
        /etc/hosts - Count: 1
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Applications/MacX Video Converter Pro.app
        [not loaded]    com.macxdvd.driver.goodSysAudioCapture (1 - SDK 10.10) [Click for support]
            /Library/Extensions
        [loaded]    com.TrustedData.driver.VendorSpecificType00 (1.7.0 - SDK 10.7) [Click for support]
        [not loaded]    com.blackmagic-design.desktopvideo.iokit.driver (10.3.4 - SDK 10.9) [Click for support]
        [not loaded]    com.blackmagic-design.desktopvideo.iokit.framebufferdriver (10.3.4 - SDK 10.9) [Click for support]
        [not loaded]    com.blackmagic-design.desktopvideo.multibridge.iokit.driver (10.3.4 - SDK 10.9) [Click for support]
        [not loaded]    com.blackmagic-design.driver.BlackmagicIO (10.3.4 - SDK 10.9) [Click for support]
        [not loaded]    com.blackmagic-design.driver.BlackmagicUsbIO (10.3.4 - SDK 10.9) [Click for support]
        [loaded]    com.drobo.SCSI.ThunderBolt (1.1 [70504] - SDK 10.8) [Click for support]
        [loaded]    com.promise.driver.stex (5.2.10 - SDK 10.9) [Click for support]
            /Library/Extensions/DeckLink_Driver.kext/Contents/PlugIns
        [not loaded]    com.blackmagic-design.desktopvideo.firmware (10.3.4 - SDK 10.9) [Click for support]
            /System/Library/Extensions
        [loaded]    com.Cycling74.driver.Soundflower (1.5.3 - SDK 10.6) [Click for support]
        [not loaded]    com.FTDI.driver.FTDIUSBSerialDriver (2.2.14) [Click for support]
        [not loaded]    com.Maxtor.driver.PowSecDriver (4.2.7) [Click for support]
        [not loaded]    com.SiliconImage.driver.Si3124u (2.0.3) [Click for support]
        [not loaded]    com.Susteen.driver.PL2303 (1.2.0) [Click for support]
        [loaded]    com.airgrab.driver.AirGrabFirewallModule (3.0) [Click for support]
        [not loaded]    com.aliph.driver.jstub (1.1.2 - SDK 10.7) [Click for support]
        [not loaded]    com.alwaysthinking.thinkinghomeUSB (1.1.7) [Click for support]
        [loaded]    com.attotech.driver.ATTOiSCSI (3.4.1b1 - SDK 10.6) [Click for support]
        [not loaded]    com.cy.iokit.Morpheus (1.4) [Click for support]
        [not loaded]    com.detto.iokit.M2MantiClassic (2.1) [Click for support]
        [not loaded]    com.devguru.driver.SamsungComposite (1.4.26 - SDK 10.6) [Click for support]
        [loaded]    com.globaldelight.driver.BoomDevice (1.1 - SDK 10.1) [Click for support]
        [not loaded]    com.hzsystems.driver.CDSDAudioCaptureSupport (1.5) [Click for support]
        [loaded]    com.hzsystems.terminus.driver (4) [Click for support]
        [not loaded]    com.perceptiveautomation.indigo_overrides.kext (1.0.0d1) [Click for support]
        [not loaded]    com.prolific.driver.PL2303 (1.2.1) [Click for support]
        [not loaded]    com.rim.driver.BlackBerryUSBDriverInt (0.0.33) [Click for support]
        [not loaded]    com.rim.driver.BlackBerryUSBDriverVSP (0.0.33) [Click for support]
        [not loaded]    com.roxio.BluRaySupport (1.1.6) [Click for support]
        [not loaded]    com.shed.PowerLinc.kext (1.0.0) [Click for support]
        [not loaded]    com.shed.PowerLincCU.kext (1.0.0) [Click for support]
        [not loaded]    com.shed.cm15.kext (1.0.0) [Click for support]
        [not loaded]    com.smithmicro.nke.NetBlockade (4.0) [Click for support]
        [not loaded]    com.wdc.driver.IOFireWireWDHID (1.1.2) [Click for support]
            /System/Library/Extensions/IOFireWireMxBt.kext
        [not loaded]    com.maxtor.iokit.IOFireWireMxBt (3.0.0) [Click for support]
            /System/Library/Extensions/ssuddrv.kext/Contents/PlugIns
        [not loaded]    com.devguru.driver.SamsungACMControl (1.4.26 - SDK 10.6) [Click for support]
        [not loaded]    com.devguru.driver.SamsungACMData (1.4.26 - SDK 10.6) [Click for support]
        [not loaded]    com.devguru.driver.SamsungMTP (1.4.26 - SDK 10.5) [Click for support]
        [not loaded]    com.devguru.driver.SamsungSerial (1.4.26 - SDK 10.6) [Click for support]
            /Users/[redacted]/Library/PreferencePanes/Contents/PlugIns/TechTool Pro 7.app
        [not loaded]    com.micromat.driver.spdKernel (1 - SDK 10.8) [Click for support]
        [not loaded]    com.micromat.driver.spdKernel-10-8 (1 - SDK 10.8) [Click for support]
            /Users/[redacted]/Library/Services/ToastIt.service/Contents/MacOS
        [not loaded]    com.roxio.TDIXController (2.0) [Click for support]
    Launch Agents: ℹ️
        [not loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.CS5ServiceManager.plist [Click for support]
        [running]    com.blackmagic-design.DesktopVideoFirmwareUpdater.plist [Click for support]
        [running]    com.micromat.TechToolProAgent.plist [Click for support]
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
        [not loaded]    com.teamviewer.teamviewer.plist [Click for support]
        [not loaded]    com.teamviewer.teamviewer_desktop.plist [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [loaded]    com.adobe.SwitchBoard.plist [Click for support]
        [running]    com.attotech.iscsid.plist [Click for support]
        [running]    com.backblaze.bzserv.plist [Click for support]
        [loaded]    com.blackmagic-design.desktopvideo.XPCService.plist [Click for support]
        [running]    com.blackmagic-design.DesktopVideoHelper.plist [Click for support]
        [running]    com.blackmagic-design.streaming.BMDStreamingServer.plist [Click for support]
        [running]    com.datarobotics.ddservice64d.plist [Click for support]
        [running]    com.datarobotics.ddserviced.plist [Click for support]
        [running]    com.micromat.TechToolProDaemon.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
        [running]    com.starfield.backupservice.plist [Click for support]
        [loaded]    com.teamviewer.Helper.plist [Click for support]
        [not loaded]    com.teamviewer.teamviewer_service.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [running]    com.backblaze.bzbmenu.plist [Click for support]
        [loaded]    com.bittorrent.uTorrent.plist [Click for support]
    User Login Items: ℹ️
        Cookie    Application  (/Applications/Cookie.app)
        Network Speed Monitor    Application  (/Applications/Network Speed Monitor.app)
        CleanAgent    Application  (/Applications/Clean.app/Contents/Resources/CleanAgent.app)
        SpeechSynthesisServer    Application  (/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks /SpeechSynthesis.framework/Versions/A/SpeechSynthesisServer.app)
        ClamXav Sentry    Application  (/Applications/ClamXav.app/Contents/Resources/ClamXav Sentry.app)
    Internet Plug-ins: ℹ️
        AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Click for support]
        Flash Player: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Click for support]
        LogMeInSafari32: Version: 1.0.1001 - SDK 10.7 [Click for support]
        Scorch: Version: Unknown - SDK 10.2 [Click for support]
        AdobeExManDetect: Version: AdobeExManDetect 1.1.0.0 - SDK 10.7 [Click for support]
        iPhotoPhotocast: Version: 7.0 - SDK 10.8
        DirectorShockwave: Version: 11.0.3r472 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        GarminGpsControl: Version: 4.2.0.0 - SDK 10.8 [Click for support]
        AmazonMP3DownloaderPlugin: Version: AmazonMP3DownloaderPlugin 1.0.17 - SDK 10.4 [Click for support]
        CANONiMAGEGATEWAYDL: Version: 3.1.0.2 [Click for support]
        DivXBrowserPlugin: Version: 2.2 [Click for support]
        Musicnotes: Version: 1.19.0 [Click for support]
        LogMeIn: Version: 1.0.1001 - SDK 10.7 [Click for support]
        OVSHelper: Version: 1.1 [Click for support]
        Google Earth Web Plug-in: Version: 6.1 [Click for support]
        AmazonMP3DownloaderPlugin101750: Version: AmazonMP3DownloaderPlugin 1.0.17 - SDK 10.4 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        Flip4Mac WMV Plugin: Version: 2.3.4.1 [Click for support]
        SharePointBrowserPlugin: Version: 14.4.7 - SDK 10.6 [Click for support]
        Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: Java 8 Update 31 Check version
        OfficeLiveBrowserPlugin: Version: 12.2.8 [Click for support]
    User internet Plug-ins: ℹ️
        WbeTools64_14: Version: 1.0.23.53 © 2013 - SDK 10.6 [Click for support]
        WebEx: Version: 1.0 [Click for support]
        WebEx64: Version: 1.0 - SDK 10.5 [Click for support]
        Folx3Plugin: Version: 4.0 - SDK 10.6 [Click for support]
        fileEditTool64_15: Version: 1.0.35.65 © 2013 - SDK 10.6 [Click for support]
    Safari Extensions: ℹ️
        Open in Internet Explorer
        SaveFrom.net helper
    3rd Party Preference Panes: ℹ️
        Akamai NetSession Preferences  [Click for support]
        APC PowerChute Personal Edition  [Click for support]
        Backblaze Backup  [Click for support]
        Blackmagic Desktop Video  [Click for support]
        Flash Player  [Click for support]
        Java  [Click for support]
        TechTool Protection  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Mobile backups: OFF
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 999.32 GB Disk used: 239.28 GB
        Destinations:
            Time Machine-Drobo [Local]
            Total size: 17.59 TB
            Total number of backups: 77
            Oldest backup: 2014-07-18 01:39:12 +0000
            Last backup: 2015-02-19 16:04:28 +0000
            Size of backup disk: Excellent
                Backup size 17.59 TB > (Disk size 999.32 GB X 3)
    Top Processes by CPU: ℹ️
            11%    WindowServer
             6%    Safari
             5%    Mail
             2%    firefox
             1%    bzfilelist
    Top Processes by Memory: ℹ️
        790 MB    firefox
        378 MB    mds_stores
        344 MB    clamd
        309 MB    Safari
        241 MB    Mail
    Virtual Memory Information: ℹ️
        21.17 GB    Free RAM
        6.67 GB    Active RAM
        4.12 GB    Inactive RAM
        2.38 GB    Wired RAM
        6.47 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Feb 19, 2015, 10:00:50 AM    Self test - passed
        Feb 18, 2015, 03:49:35 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/AgileTransCmd_2015-02-18-15493 5_[redacted].crash
        Feb 18, 2015, 03:44:30 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/AgileTransCmd_2015-02-18-15443 0_[redacted].crash
        Feb 16, 2015, 12:12:51 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/mdworker_2015-02-16-121251_[re dacted].crash

    Starting your Mac in "Safe Mode" (see below) will load only Apple-provided kernel extensions. Observing its perfomance in that mode will be instructive.
    The problems you describe are likely to have been caused by garbage software of which "TechTool Pro" is only one example. That system has been altered from its factory configuration through the installation of several third party system modifications, any one of which can cause poor performance. Interaction between two or more is another possibility. Running a torrent client is another way of inviting malware intrusion.
    Safe Mode or "Safe Boot" is a troubleshooting mode that bypasses all third party system extensions and loads only required system components. Read about it: Starting up in Safe Mode
    You must disable FileVault before you can start your Mac in Safe Mode.
    Starting your Mac in Safe Mode will take longer than usual, graphics will not render smoothly, audio is disabled on some Macs, and some programs (iTunes for example) may not work at all.
    Merely starting your Mac in Safe Mode is not intended to resolve the problem, it's to observe its performance without certain additional components.
    To end Safe Mode restart your Mac normally. Shutdown will take longer as well.

Maybe you are looking for