Rob Spoor

+ Follow
since Oct 27, 2005
Rob likes ...
Chrome Eclipse IDE Java Windows
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rob Spoor

From Calendar.HOUR:

Field number for get and set indicating the hour of the morning or afternoon. HOUR is used for the 12-hour clock (0 - 11). Noon and midnight are represented by 0, not by 12. E.g., at 10:04:15.250 PM the HOUR is 10.

For HOUR 0, there are two possible values, depending on the current AM/PM value: 12:00 AM or 12:00 PM. It just changes the hour within the same 12 hour window.

On a side note, Calendar and Date are sort of deprecated; you should consider taking a look at LocalDate and LocalDateTime.
6 hours ago
Welcome to the Ranch!

Looks like a class loading issue. Even though the back-end JPA technology should be transparent, the entities that you retrieve do contain some Hibernate specific internal fields or something like that. Did you try adding the Hibernate JAR files to your class path?
Can't you specify that either class ManagementServiceImpl or method ManagementServiceImpl.raiseAlarm runs either with no transaction (@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)) or a new transaction (@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)?
I doubt there is one book that discusses both subjects. Just get separate books or other resources.
The two are completely separate technologies. You can use the same Angular front-end code with a Spring (Boot) application, JEE application using JAX-RS, or anything else, as long as the endpoints that you call from Angular are the same.

Paul David Bull wrote:Also, POST works with curl but not when url is passed into browser or when called from angular 5 page.

You can't do a POST by entering the URL in a browser - that's always a GET. The only way to do a POST from the browser is by using an HTML form with action=POST or by using AJAX calls. Depending on how you're calling this from the Angular page, this might be the same issue.
6 days ago
The database model is just fine, there's no need to change that.

But why do you need to show records of the link table on your screen?
Why do you think you even need class EmployeePersonnel? The @ManyToMany annotations should take care of that.

Speaking of the many-to-many, you now have two distinct many-to-many relations that just happen to use the same join table. That's asking for trouble. You should instead:
  • Choose one of the sides as being the owner. That one gets the @JoinTable annotation. You specify the join columns of the other entity type with the inverseJoinColumns property.
  • The other side doesn't need the @JoinTable annotation. Instead, its @ManyToMany annotation should have its mappedBy set to the name of the property in the other entity. So if you use EmployeeType as the owner, then the @ManyToMany in PersonnelType gets a mappedBy value of personnelTypes. If you do it the other way around, then the mappedBy goes to the EmployeeType class with value employeeTypes.

  • Now here is something that's very important, at least in Hibernate: the owner matters. The owner's list should be used to make changes to the link table (add or remove elements). If you don't then changes will not get persisted in the database. (At least, that was my experience when migrating from TopLink to Hibernate in Spring Boot 1.5.)
    Although mark is a no-op in InputStream, reset throws an exception if the method is not overridden:

    Conclusion: use markSupported to check if you can use mark and reset.
    2 weeks ago
    You need two static imports:
    3 weeks ago
    I figured that out, that's why I mentioned the CookieHandler. You still need two HttpURLConnection instances, because the two URLs are (most likely) not the same.
    3 weeks ago
    Another alternative could be to drop the XmlEnumValue annotations, and use an XmlAdapter to perform the conversion instead. You can annotate your enum with @XmlJavaTypeAdapter to make sure it's always used instead of the default marshalling / unmarshalling:
    3 weeks ago