Azavea.Open.DAO.OleDb.OleDbOracleDaLayer.StoreRoomMissing C# (CSharp) Method

StoreRoomMissing() public method

Returns true if you need to call "CreateStoreRoom" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store room can return "false" from this method without breaking either a user's app or the spirit of the method. Store room typically corresponds to "table".
public StoreRoomMissing ( ClassMapping mapping ) : bool
mapping ClassMapping
return bool
        public override bool StoreRoomMissing(ClassMapping mapping)
        {
            // The user_tables doesn't store names with the owner prefix, remove it
            // for the query
            var start = mapping.Table.LastIndexOf('.');

            // -1 is not found, but is not a good index, use 0
            start = start != -1 ? (start + 1) : 0;

            int count = SqlConnectionUtilities.XSafeIntQuery(_connDesc,
                "SELECT COUNT(*) FROM user_tables where table_name = '" +
                mapping.Table.Substring(start).ToUpper() + "'", null);
            return count == 0;
        }