|
|
|
@ -2,7 +2,10 @@ package me.bearns.fias.helpers; |
|
|
|
|
|
|
|
|
|
import me.bearns.fias.domain.AddressObjects; |
|
|
|
|
import me.bearns.fias.domain.Addrobj; |
|
|
|
|
import me.bearns.fias.domain.House; |
|
|
|
|
import me.bearns.fias.domain.Houses; |
|
|
|
|
import me.bearns.fias.repository.AddrobjRepository; |
|
|
|
|
import me.bearns.fias.repository.HouseRepository; |
|
|
|
|
import org.springframework.data.jpa.repository.JpaRepository; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
@ -15,7 +18,7 @@ public class Catalog { |
|
|
|
|
|
|
|
|
|
private final List<Item> prefixList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
public Catalog(AddrobjRepository ADDROBJ_REPOSITORY) { |
|
|
|
|
public Catalog(AddrobjRepository ADDROBJ_REPOSITORY, HouseRepository HOUSE_REPOSITORY) { |
|
|
|
|
prefixList.add( |
|
|
|
|
new Item( |
|
|
|
|
"AS_ADDROBJ_", |
|
|
|
@ -28,10 +31,10 @@ public class Catalog { |
|
|
|
|
prefixList.add( |
|
|
|
|
new Item( |
|
|
|
|
"AS_HOUSE_", |
|
|
|
|
null, |
|
|
|
|
HOUSE_REPOSITORY, |
|
|
|
|
new QName("","House"), |
|
|
|
|
null, |
|
|
|
|
null |
|
|
|
|
House.class, |
|
|
|
|
Houses.class |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -46,6 +49,10 @@ public class Catalog { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<Item> getAll() { |
|
|
|
|
return prefixList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class Item implements UnmarshallerParameters { |
|
|
|
|
private Item(String prefix, JpaRepository repository, QName qName, Class cls, Class parentCls) { |
|
|
|
|
this.prefix = prefix; |
|
|
|
|