[midPoint] scriptedsql example

Frigerio, Joshua joshua at uic.edu
Tue Aug 14 16:23:19 CEST 2018


Hey, can anyone throw me a rope.  How do I get a scriptedsql resource to
read the “datetime” type as a date into Midpoint?
I tried setting “All native” to true.  No help.
I keep getting the same error:

	"Attribute 'birth' type 'class java.sql.Timestamp' is not supported.’"

Thanks.


-----Original Message-----
From: midPoint <midpoint-bounces at lists.evolveum.com> on behalf of joe
schmoe <joshua at uic.edu>
Reply-To: midPoint General Discussion <midpoint at lists.evolveum.com>
Date: Friday, August 3, 2018 at 8:21 PM
To: midPoint General Discussion <midpoint at lists.evolveum.com>
Subject: Re: [midPoint] scriptedsql example

>>
>>If you don't want to handle this date as a real date, just convert it to
>>string using mysql cast function:
>
>I want it to remain a date.
>I figured in the SchemaScript.groovy, I’d change it to tell Midpoint it’s
>a date, using this line:
>
>account.addAttributeInfo(AttributeInfoBuilder.build("birthdate",
>String.class));
>
>But nothing I change it to matters, same error every time: "Attribute
>'birthdate' type 'class java.sql.Timestamp' is not supported.”.  :-(
>
>Or am I going about it wrong? How do I get it to see that datetime field
>as a datetime field?
>
>
>
>>
>>select cast(timestamp as char) as timestamp
>>
>>
>>W dniu 03.08.2018 o 21:27, Frigerio, Joshua pisze:
>>>> You have:
>>>> sql.eachRow("SELECT name,timestamp,id,notes,birthdate,netid FROM
>>>>person "
>>>> + where, {result.add([__UID__:it.id, __NAME__:it.netid,  ])} );
>>>>
>>>> Should be:
>>>> sql.eachRow("SELECT name,timestamp,id,notes,birthdate,netid FROM
>>>>person "
>>>> + where, {result.add([__UID__:it.id, __NAME__:it.netid,
>>>>notes:it.notes,
>>>> birthdate:it.birthdate])} );
>>> Ug, that was right there in the example too, somehow I missed thatŠ.
>>> Thanks!
>>>
>>> Although it doesn¹t work for date fields (datetime or timestamp mysql
>>> types). If I try to add the ³timestamp² field or the ³birthdate" field,
>>>it
>>> says, ³Got unexpected exception: java.lang.IllegalArgumentException:
>>> Attribute 'birthdate' type 'class java.sql.Timestamp' is not
>>>supported."
>>> In the schema groovy script, I told it to treat it as a String.class,
>>>but
>>> it doesn¹t work anyway. :-(
>>>
>>> _______________________________________________
>>> midPoint mailing list
>>> midPoint at lists.evolveum.com
>>> http://lists.evolveum.com/mailman/listinfo/midpoint
>>
>>-- 
>>Wojciech Staszewski
>>Administrator Systemów Sieciowych
>>tel. kom: 663 680 236
>>www.diagnostyka.pl
>>Diagnostyka Sp. z o. o.
>>ul. Prof. M. Życzkowskiego 16, 31-864 Kraków
>>Numer KRS: 0000381559 (Sąd Rejonowy dla Krakowa-Śródmieścia w Krakowie,
>>XI Wydział Gospodarczy KRS)
>>NIP: 675-12-65-009; REGON: 356366975
>>Kapitał zakładowy: 33 756 500 zł.
>>
>>Pomyśl o środowisku zanim wydrukujesz ten e-mail.
>>
>>_______________________________________________
>>midPoint mailing list
>>midPoint at lists.evolveum.com
>>http://lists.evolveum.com/mailman/listinfo/midpoint
>
>_______________________________________________
>midPoint mailing list
>midPoint at lists.evolveum.com
>http://lists.evolveum.com/mailman/listinfo/midpoint



More information about the midPoint mailing list