Align with published QQQ 4.1 and preserve KOF22 integration #24
No files matched your search
@@ -50,7 +50,8 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<revision>0.1.0</revision>
|
||||
<revision>0.2.0-SNAPSHOT</revision>
|
||||
<qqq.version>4.1.0-RC.21</qqq.version>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -58,11 +59,10 @@
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
<!-- One JUnit line. The QQQ 4.1 BOM inherits junit-jupiter-engine/params at 6.0.2 from qqq-parent-project, while this pom's JUnit BOM
|
||||
manages junit-jupiter, the API and the platform at 5.10.0; the mixed engine fails discovery ("TestEngine with ID 'junit-jupiter'
|
||||
failed to discover tests") and no test runs. Import this pom's own JUnit version first (first import wins) so every JUnit
|
||||
artifact converges on 5.10.0. -->
|
||||
<dependency>
|
||||
<groupId>org.junit</groupId>
|
||||
<artifactId>junit-bom</artifactId>
|
||||
@@ -70,6 +70,19 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<!-- Published QQQ 4.1 core (minimum QQQ 4.1), imported ahead of the parent's BOM. -->
|
||||
<dependency>
|
||||
<groupId>com.kingsrook.qqq</groupId>
|
||||
<artifactId>qqq-bom-pom</artifactId>
|
||||
<version>${qqq.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
|
||||
@@ -126,6 +126,10 @@ public class GeoDataQBitProducer implements QBitProducer
|
||||
*******************************************************************************/
|
||||
private void updateForeignKeyReferences(QTableMetaData table)
|
||||
{
|
||||
if(table.getFields() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
table.getFields().values().forEach(field ->
|
||||
{
|
||||
if(field.getPossibleValueSourceName() != null)
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
|
||||
|
||||
|
||||
@QMetaDataProducingEntity(producePossibleValueSource = true)
|
||||
@QMetaDataProducingEntity(produceTableMetaData = true, producePossibleValueSource = true)
|
||||
public class City extends QRecordEntity
|
||||
{
|
||||
public static final String TABLE_NAME = "city";
|
||||
@@ -204,4 +204,103 @@ public class City extends QRecordEntity
|
||||
{
|
||||
return modifyDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for id (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for stateProvinceId (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setStateProvinceId(Integer stateProvinceId)
|
||||
{
|
||||
this.stateProvinceId = stateProvinceId;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for name (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for asciiName (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setAsciiName(String asciiName)
|
||||
{
|
||||
this.asciiName = asciiName;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for population (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setPopulation(Integer population)
|
||||
{
|
||||
this.population = population;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for latitude (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setLatitude(BigDecimal latitude)
|
||||
{
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for longitude (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setLongitude(BigDecimal longitude)
|
||||
{
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for timezone (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setTimezone(String timezone)
|
||||
{
|
||||
this.timezone = timezone;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for isActive (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setIsActive(Boolean isActive)
|
||||
{
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for createDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setCreateDate(Instant createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for modifyDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setModifyDate(Instant modifyDate)
|
||||
{
|
||||
this.modifyDate = modifyDate;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
|
||||
|
||||
|
||||
@QMetaDataProducingEntity(producePossibleValueSource = true)
|
||||
@QMetaDataProducingEntity(produceTableMetaData = true, producePossibleValueSource = true)
|
||||
public class Country extends QRecordEntity
|
||||
{
|
||||
public static final String TABLE_NAME = "country";
|
||||
@@ -171,4 +171,85 @@ public class Country extends QRecordEntity
|
||||
{
|
||||
return modifyDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for id (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for alpha2Code (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setAlpha2Code(String alpha2Code)
|
||||
{
|
||||
this.alpha2Code = alpha2Code;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for alpha3Code (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setAlpha3Code(String alpha3Code)
|
||||
{
|
||||
this.alpha3Code = alpha3Code;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for numericCode (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setNumericCode(Integer numericCode)
|
||||
{
|
||||
this.numericCode = numericCode;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for name (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for officialName (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setOfficialName(String officialName)
|
||||
{
|
||||
this.officialName = officialName;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for isActive (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setIsActive(Boolean isActive)
|
||||
{
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for createDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setCreateDate(Instant createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for modifyDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setModifyDate(Instant modifyDate)
|
||||
{
|
||||
this.modifyDate = modifyDate;
|
||||
}
|
||||
}
|
||||
+73
-1
@@ -13,7 +13,7 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.producers.annotations.QMetaDataProducingEntity;
|
||||
|
||||
|
||||
@QMetaDataProducingEntity(producePossibleValueSource = true)
|
||||
@QMetaDataProducingEntity(produceTableMetaData = true, producePossibleValueSource = true)
|
||||
public class StateProvince extends QRecordEntity
|
||||
{
|
||||
public static final String TABLE_NAME = "stateProvince";
|
||||
@@ -155,4 +155,76 @@ public class StateProvince extends QRecordEntity
|
||||
{
|
||||
return modifyDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for id (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for countryId (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setCountryId(Integer countryId)
|
||||
{
|
||||
this.countryId = countryId;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for code (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for name (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for subdivisionType (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setSubdivisionType(String subdivisionType)
|
||||
{
|
||||
this.subdivisionType = subdivisionType;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for isActive (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setIsActive(Boolean isActive)
|
||||
{
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for createDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setCreateDate(Instant createDate)
|
||||
{
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for modifyDate (QRecordEntity discovers a field only from a getter and setter pair).
|
||||
*******************************************************************************/
|
||||
public void setModifyDate(Instant modifyDate)
|
||||
{
|
||||
this.modifyDate = modifyDate;
|
||||
}
|
||||
}
|
||||
+32
@@ -78,6 +78,38 @@ class GeoDataQBitProducerTest
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** The enabled entities produce their tables, on the configured backend, with the
|
||||
** prefix; the possible value sources point at tables that exist. (On core 4.1 an
|
||||
** entity annotation only produces a table when it asks for it.)
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void testProduce_createsTablesAndPossibleValueSourcesPointAtThem() throws QException
|
||||
{
|
||||
QInstance qInstance = new QInstance();
|
||||
qInstance.addBackend(new QBackendMetaData().withName("rdbms"));
|
||||
|
||||
new GeoDataQBitProducer()
|
||||
.withConfig(new GeoDataQBitConfig().withBackendName("rdbms").withTableNamePrefix("geo")
|
||||
.withEnableCountries(true).withEnableStateProvinces(true).withEnableCities(true))
|
||||
.produce(qInstance, "geo");
|
||||
|
||||
assertThat(qInstance.getTables().keySet()).contains("geo_country", "geo_stateProvince", "geo_city");
|
||||
assertThat(qInstance.getTable("geo_city").getBackendName()).isEqualTo("rdbms");
|
||||
assertThat(qInstance.getTable("geo_country").getPrimaryKeyField()).isEqualTo("id");
|
||||
assertThat(qInstance.getTable("geo_country").getFields().keySet()).contains("alpha2Code", "name", "isActive");
|
||||
assertThat(qInstance.getTable("geo_city").getFields().keySet()).contains("name");
|
||||
for(var pvs : qInstance.getPossibleValueSources().values())
|
||||
{
|
||||
if(pvs.getTableName() != null)
|
||||
{
|
||||
assertThat(qInstance.getTable(pvs.getTableName())).as(pvs.getName()).isNotNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Test that producer stores config in QBit metadata.
|
||||
*******************************************************************************/
|
||||
|
||||
Reference in new issue
Block a user