sdeleuze
12/27/2016, 1:50 PMsdeleuze
12/27/2016, 1:50 PMenleur
12/27/2016, 8:14 PMsdeleuze
12/27/2016, 9:26 PMopen
keywords, I have updated https://github.com/sdeleuze/spring-boot-kotlin-demo accordinglyenleur
12/27/2016, 9:49 PMsdeleuze
12/27/2016, 10:08 PMval
properties) by creating automatically a synthetic noarg constructorsdeleuze
12/27/2016, 10:08 PMnoarg
plugin pre-configured to apply on JPA @Entity
sdeleuze
12/27/2016, 10:09 PMenleur
12/27/2016, 10:14 PMjakub.dyszkiewicz
12/28/2016, 2:50 PMjakub.dyszkiewicz
12/28/2016, 2:51 PMjakub.dyszkiewicz
12/28/2016, 2:52 PMjakub.dyszkiewicz
12/28/2016, 2:52 PMenleur
12/28/2016, 2:52 PMmichael.barker
12/28/2016, 2:57 PMsdeleuze
12/28/2016, 11:44 PMdstarcev
12/30/2016, 1:10 PMdstarcev
12/30/2016, 1:11 PMdata class InvitationListItem(
var created: Date = Date(),
var role: DealRole = DealRole.Seller,
var email: String = "",
var phone: String = "",
var inviteeId: Long? = null,
var inviteeName: String = ""
) : Serializable
interface InvitationRepository : JpaRepository<Invitation, UUID> {
@Query("""
select
invitations.created,
invitations.role,
invitations.email,
invitations.phone,
invitations.invitee_id,
users.name as inviteeName
from invitations
left join users
on users.id = invitations.invitee_id
where invitations.status != 'Declined'
and invitations.deal_id = ?1""", nativeQuery = true)
fun getDealInvitations(dealId: Long): List<InvitationListItem>
}
dstarcev
12/30/2016, 1:13 PMCaused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.sql.Timestamp] to type [com.buythewhale.features.deals.invitations.InvitationListItem]
jakub.dyszkiewicz
12/30/2016, 3:00 PMnew package.InvitationListItem(invitations.created, invitation.role…)
in your query I guessjakub.dyszkiewicz
12/30/2016, 3:05 PMsdeleuze
01/04/2017, 2:06 PMirus
01/04/2017, 2:36 PMThat allows to provide convenient API for RestTemplate (thanks to Jon Schneider from Netflix for contributing this). For example, to retrieve a list of Foo objects in Java you have to write:List<Foo> result = restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<List<Foo>>() { }).getBody();
While in Kotlin with Spring Framework 5 extensions you will be able to write:can be wrote in more nice way in java:val result : List<Foo> = restTemplate.getForObject(url)
List<Foo> result = Arrays.asList(restTemplate.getForObject(url, Foo[].class))
sdeleuze
01/04/2017, 2:37 PMsdeleuze
01/04/2017, 2:37 PMsdeleuze
01/04/2017, 2:38 PMsdeleuze
01/04/2017, 2:39 PMsdeleuze
01/04/2017, 2:41 PMirus
01/04/2017, 2:41 PMsdeleuze
01/04/2017, 2:42 PM