<commit_before>package com.venky.swf.plugins.collab.db.model.config;

import java.util.List;

import com.venky.swf.db.Database;
import com.venky.swf.db.annotations.column.IS_NULLABLE;
import com.venky.swf.db.annotations.column.UNIQUE_KEY;
import com.venky.swf.db.annotations.column.indexing.Index;
import com.venky.swf.db.annotations.model.CONFIGURATION;
import com.venky.swf.db.annotations.model.EXPORTABLE;
import com.venky.swf.db.annotations.model.ORDER_BY;
import com.venky.swf.db.model.Model;
import com.venky.swf.sql.Conjunction;
import com.venky.swf.sql.Expression;
import com.venky.swf.sql.Operator;
import com.venky.swf.sql.Select;

@CONFIGURATION
@EXPORTABLE(false)
@ORDER_BY("NAME")
public interface City extends Model {
	@Index
	@UNIQUE_KEY
	public String getName();
	public void setName(String name);
	
	@Index
	@UNIQUE_KEY
	@IS_NULLABLE(false)
	public Long getStateId();
	public void setStateId(Long id);
	public State getState();
	
	public static City findByCountryAndStateAndName(String  countryName , String stateName,String cityName) { 
		return findByStateAndName(State.findByCountryAndName(countryName, stateName).getId(), cityName);
	}
	public static City findByStateAndName(long stateId, String cityName) {
		Select s = new Select().from(City.class); 
		Expression where = new Expression(s.getPool(),Conjunction.AND);
		where.add(new Expression(s.getPool(),"NAME",Operator.EQ,cityName));
		where.add(new Expression(s.getPool(),"STATE_ID",Operator.EQ,stateId));
		
		List<City> cities = s.where(where).execute(); 
		if (cities.size() == 1) {
			return cities.get(0);
		}else {
			City city = Database.getTable(City.class).newRecord(); 
			city.setStateId(stateId);
			city.setName(cityName);
			city.save();
			return city;
		}
	}
}
<commit_msg>Lat long added in city<commit_after>package com.venky.swf.plugins.collab.db.model.config;

import java.util.List;

import com.venky.geo.GeoLocation;
import com.venky.swf.db.Database;
import com.venky.swf.db.annotations.column.IS_NULLABLE;
import com.venky.swf.db.annotations.column.UNIQUE_KEY;
import com.venky.swf.db.annotations.column.indexing.Index;
import com.venky.swf.db.annotations.model.CONFIGURATION;
import com.venky.swf.db.annotations.model.EXPORTABLE;
import com.venky.swf.db.annotations.model.ORDER_BY;
import com.venky.swf.db.model.Model;
import com.venky.swf.sql.Conjunction;
import com.venky.swf.sql.Expression;
import com.venky.swf.sql.Operator;
import com.venky.swf.sql.Select;

@CONFIGURATION
@EXPORTABLE(false)
@ORDER_BY("NAME")
public interface City extends Model , GeoLocation {
	@Index
	@UNIQUE_KEY
	public String getName();
	public void setName(String name);
	
	@Index
	@UNIQUE_KEY
	@IS_NULLABLE(false)
	public Long getStateId();
	public void setStateId(Long id);
	public State getState();
	
	public static City findByCountryAndStateAndName(String  countryName , String stateName,String cityName) { 
		return findByStateAndName(State.findByCountryAndName(countryName, stateName).getId(), cityName);
	}
	public static City findByStateAndName(long stateId, String cityName) {
		Select s = new Select().from(City.class); 
		Expression where = new Expression(s.getPool(),Conjunction.AND);
		where.add(new Expression(s.getPool(),"NAME",Operator.EQ,cityName));
		where.add(new Expression(s.getPool(),"STATE_ID",Operator.EQ,stateId));
		
		List<City> cities = s.where(where).execute(); 
		if (cities.size() == 1) {
			return cities.get(0);
		}else {
			City city = Database.getTable(City.class).newRecord(); 
			city.setStateId(stateId);
			city.setName(cityName);
			city.save();
			return city;
		}
	}
}

{'fraction_non_alphanumeric': 0.13346336026748398, 'fraction_numerical': 0.0011145165784341043, 'mean_word_length': 5.298245614035087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2774156', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1252, 'n_words': 219}