I am having problems with EclipseLink change tracking in one of my entity classes in a Java SE application. I am using Java 8, JPA 3.0 provided by EclipseLink 3.0.2 and HyperSQL 2.6.1. So far I have kept my implementation provider-independent, so switching JPA providers is an option, although not preferable. This particular entity class has ~10 attributes of the
Tag: converters
HttpMessageConverter for Single Object and List of Object
I have an Object (here: Property) and I want to add csv export ability to my Spring Backend for single and list of objects. I added this to my config: and the Property Converter looks like this: This code works for a Single Property. When I try to return a list of Properties: I tried to add a PropertyListConverter but
How do I convert an Int to an Int[] in java?
I want to convert a primitive Java integer value: To an integer array: Answer There can be so many ways to do it. A concise way of doing it’s using Stream API as shown below: Output: Notes: ASCII value of ‘0’ is 48, that of ‘1’ is 49 and so on. Math#abs returns the absolute value of an int value
Convert seconds into T1H15M5S (ISO_8601)
I would like to convert a number of seconds into ISO_8601/Duration in Java. http://en.wikipedia.org/wiki/ISO_8601#Durations Are there any existing methods to do it that are already built in? Answer Since ISO 8601 allows for the individual fields in a duration string to overflow, you could just prepend “PT” to the number of seconds and append “S”: This will output “PT4711S”, which
Placing a converted value inside a rich:simpleTogglePanel label
I’m in a situation where I need to place a date value inside a rich:simpleTogglePanel label. The problem is I need to converter the date prior to displaying it, using Then I need to place another string in front of it. Unfortunately label is an attribute and only takes a string. Is there anyway to do this? Any undocumented label