if (logger.isInfoEnabled()) logger.info("Executing startup task [GenerateSexTableDataStartupTask]");
Long count = (Long) dao.executeQuery("SELECT COUNT(s) FROM Sex s").get(0);
if (count <= 0) {
if (logger.isInfoEnabled()) logger.info("Sex table is empty. Generating data...");
Sex male = new Sex();
I18nText dataMale = new I18nText();
male.setSex(dataMale);
Sex female = new Sex();
I18nText dataFemale = new I18nText();
female.setSex(dataFemale);
for (Locale locale : supportedLocales) {
dataMale.add(locale, MALE_VALUES.get(locale));
dataFemale.add(locale, FEMALE_VALUES.get(locale));
}
if (logger.isInfoEnabled()) logger.info("Saving male data...");
dao.create(male);
if (logger.isInfoEnabled()) logger.info("Saving female data...");
dao.create(female);