Roland Häder [Thu, 1 Sep 2016 15:34:20 +0000 (17:34 +0200)]
Continued a bit:
- close internal TODO as the user-actiity-log can be used for this
- for this making easily to work, 2 new business methods have been added
- fetchAllUsersActivityLogByType() for a single type per user
- fetchAllUsersActivityLogByMultipleType() for multiple types per user
Roland Häder [Wed, 31 Aug 2016 14:45:52 +0000 (16:45 +0200)]
Please cherry-pick:
- the user instance needs to be merged into current persience context, else some of its child entities will be persisted (inserted) again
Roland Häder [Wed, 31 Aug 2016 13:32:16 +0000 (15:32 +0200)]
Please cherry-pick:
- renamed updatedUser -> managedUser
- better set all data in EJB to avoid managedUser become detached (as the scope is not EJB anymore)
Roland Häder [Thu, 25 Aug 2016 12:23:11 +0000 (14:23 +0200)]
Please cherry-pick:
- first the user instance must become managed, then persist log entry ...
- better check for Long, and not != null test (very lazy)
Roland Häder [Thu, 25 Aug 2016 10:34:53 +0000 (12:34 +0200)]
Please cherry-pick: (be careful with project-specific names!)
- <Project>UserActivitySessionBean should better extend BaseDatabaseBean as no mail is being sent from this type of EJB
- added activity JMS queue
- implemented it in message-driven bean
- this whole thing may be shortened to only the EJB but then it is synchronous and people then will experience a slow down on heavy load
Roland Häder [Thu, 25 Aug 2016 09:44:37 +0000 (11:44 +0200)]
Please cherry-pick:
- added message-driven bean (unfinished) for adding user activity log
- this is asynchronous and won't cause application freezes if inserting takes some time
Roland Häder [Wed, 24 Aug 2016 11:09:01 +0000 (13:09 +0200)]
Please cherry-pick:
- sadly all getReference() + merge() was based on wrong assumption, now find() returns a managed entity where all setter calls leads to an update
- used getManaged() of repeating code (DRY)
Roland Häder [Tue, 23 Aug 2016 15:50:42 +0000 (17:50 +0200)]
Please cherry-pick:
- if you don't want to have redundant entries (=objects aka. entities) in database of referenced entities, first you need to merge it as it is detached
- then you have a managed instance which you can set in the referencing entity back
- if you don't do this, the entity manager will "think" it is a new instance and persists + relinks it
- maybe some implementations don't do this, but the JPA standard (generic) seems to want to have this way
- do never implement for only one JPA implementation! Do always follow the generic JPA way
Roland Häder [Tue, 23 Aug 2016 13:03:00 +0000 (15:03 +0200)]
Please cherry-pick:
- copy all data from detached to managed instance before updating it
- this needs to be done before the updated timestamp is being set to make sure it is not overwritten by old value (as copyAll() may do it)
Roland Häder [Tue, 23 Aug 2016 12:13:53 +0000 (14:13 +0200)]
Please cherry-pick:
- implemented business methods for deleting/updating fax/land-line numbers
- better this way: managedBla = em.find(Bla.class, bla.getBlaId()); and then managedBla.setBlaSomeFoo(someFooValue);
Roland Häder [Tue, 23 Aug 2016 09:33:14 +0000 (11:33 +0200)]
Please cherry-pick:
- detachAllContactPhoneEntries() was a bad idea, beter do it the old way.
- The returned instance was a managed instance that have been updated. First find it with find() then you have a managed instanced. Now simply update the fields you want and you are done.
Roland Häder [Thu, 18 Aug 2016 15:05:12 +0000 (17:05 +0200)]
Continued a bit: (please cherry-pick)
- implemented missing methods
- these include a lot tests and are currently untested (may not work)
- some to specific exceptions has been replaced by a more generic exception (which is fine here)
Roland Häder [Tue, 16 Aug 2016 14:30:20 +0000 (16:30 +0200)]
Continued a bit: (please cherry-pick)
- implemented business methods findFaxNumberById() and findLandLineNumberById()
- sorted members
- fixed log message: cellphone -> mobile again and always use "number" suffix
Roland Häder [Thu, 11 Aug 2016 10:30:39 +0000 (12:30 +0200)]
Continued with lock/unlock user accounts: (please cherry-pick)
- return detached and updated user instance on locking/unlocking
- update data in found instance and then merge it? A bit confusing ...
Roland Häder [Wed, 10 Aug 2016 12:53:58 +0000 (14:53 +0200)]
Fixed: (please cherry-pick)
- em.remove() needs a managed entity, not a one passed from e.g. a controller
- still this method may throw an exception, e.g. when an other entity (table) references this entity
- but since deleteCellphoneNumber() *should* delete cell phone numbers, it doesn't care if the entity is still referenced.
- this needs to be taken care of the controller and not the EJB (job-executor)
Roland Häder [Wed, 10 Aug 2016 11:05:22 +0000 (13:05 +0200)]
Rewrite continued: (please cherry-pick)
- moved business methods to proper EJB as they are not contact-related but "phone-generic" enough. Maybe still mail notifications can be added to them.
Roland Häder [Mon, 8 Aug 2016 14:27:05 +0000 (16:27 +0200)]
Continued: (please cherry-pick)
- implemented allSomeNumbers() methods
- used MessageFormat
- ignored strings for i18n
- exposed list to method body to have it being logged in trace message
Signed-off-by: Roland Häder <roland@haeder.net> Signed-off-by: Roland Häder <roland@mxchange.org>
Roland Häder [Fri, 5 Aug 2016 10:45:14 +0000 (12:45 +0200)]
Continued with splitting EJB: (please cherry-pick)
- splitted user bean into general (old) and administrative user bean. This allows more distribution and not centralization of all business methods on one (then later even monolithic) EJB
- requires juser-lib.jar to be updated
Signed-off-by: Roland Häder <roland@haeder.net> Signed-off-by: Roland Häder <roland@mxchange.org>
Roland Häder [Thu, 4 Aug 2016 09:50:46 +0000 (11:50 +0200)]
Fixed: (please cherry-pick)
- wrong check, opps, copy-paste mistake: user.userId must be valid set
as the user is going to be linked with password history entry.
Roland Häder [Wed, 3 Aug 2016 08:27:47 +0000 (10:27 +0200)]
Please cherry-pick / fix Copyright:
- added EJB for fetching user's full password history
- this EJB implementes the corresponding (newly added) remote interface