当前位置: 首页>>代码示例>>Java>>正文


Java StatementContext.setAttribute方法代码示例

本文整理汇总了Java中org.skife.jdbi.v2.StatementContext.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java StatementContext.setAttribute方法的具体用法?Java StatementContext.setAttribute怎么用?Java StatementContext.setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.skife.jdbi.v2.StatementContext的用法示例。


在下文中一共展示了StatementContext.setAttribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Location map(int index, ResultSet rs, StatementContext ctx) throws SQLException {
	Location l = new Location();
	l.setId(rs.getInt("id"));
	l.setName(rs.getString("name"));
	l.setLat(rs.getDouble("lat"));
	l.setLng(rs.getDouble("lng"));
	l.setCreatedAt(new DateTime(rs.getTimestamp("createdAt")));
	l.setUpdatedAt(new DateTime(rs.getTimestamp("updatedAt")));
	l.setLoadLevel(LoadLevel.PROPERTIES);
	
	if (MapperUtils.containsColumnNamed(rs, "totalCount")) { 
		ctx.setAttribute("totalCount", rs.getInt("totalCount"));
	}
	
	return l;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:18,代码来源:LocationMapper.java

示例2: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Position map(int index, ResultSet rs, StatementContext ctx) throws SQLException {
	//This hits when we do a join but there's no Billet record. 
	if (rs.getObject("positions_id") == null) { return null; }
	
	Position p = fillInFields(new Position(), rs);
	
	if (MapperUtils.containsColumnNamed(rs, "totalCount")) { 
		ctx.setAttribute("totalCount", rs.getInt("totalCount"));
	}
	
	if (MapperUtils.containsColumnNamed(rs, "people_id")) { 
		PersonMapper.fillInFields(p.getPerson(), rs);
	}
	return p;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:17,代码来源:PositionMapper.java

示例3: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Organization map(int index, ResultSet r, StatementContext ctx) throws SQLException {
	Organization org = new Organization();
	org.setId(r.getInt("organizations_id"));
	org.setShortName(r.getString("organizations_shortName"));
	org.setLongName(r.getString("organizations_longName"));
	org.setType(MapperUtils.getEnumIdx(r, "organizations_type", OrganizationType.class));
	
	Integer parentOrgId = MapperUtils.getInteger(r, "organizations_parentOrgId");
	if (parentOrgId != null) { 
		org.setParentOrg(Organization.createWithId(parentOrgId));
	}
	
	org.setCreatedAt(new DateTime(r.getTimestamp("organizations_createdAt")));
	org.setUpdatedAt(new DateTime(r.getTimestamp("organizations_updatedAt")));
	org.setLoadLevel(LoadLevel.PROPERTIES);
	
	if (MapperUtils.containsColumnNamed(r, "totalCount")) { 
		ctx.setAttribute("totalCount", r.getInt("totalCount"));
	}
	
	return org;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:24,代码来源:OrganizationMapper.java

示例4: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Poam map(int index, ResultSet r, StatementContext ctx) throws SQLException {
	Poam p = new Poam();
	p.setId(r.getInt("id"));
	p.setLongName(r.getString("longName"));
	p.setShortName(r.getString("shortName"));
	p.setCategory(r.getString("category"));
	p.setStatus(MapperUtils.getEnumIdx(r, "status", PoamStatus.class));
	
	Integer parentPoamId = MapperUtils.getInteger(r, "parentPoamId");
	if (parentPoamId != null) { 
		p.setParentPoam(Poam.createWithId(parentPoamId));
	}
	
	Integer responsibleOrgId = MapperUtils.getInteger(r, "organizationId");
	if (responsibleOrgId != null) { 
		p.setResponsibleOrg(Organization.createWithId(responsibleOrgId));
	}
	
	p.setCreatedAt(new DateTime(r.getTimestamp("createdAt")));
	p.setUpdatedAt(new DateTime(r.getTimestamp("updatedAt")));
	
	if (MapperUtils.containsColumnNamed(r, "totalCount")) { 
		ctx.setAttribute("totalCount", r.getInt("totalCount"));
	}
	
	return p;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:29,代码来源:PoamMapper.java

示例5: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Person map(int index, ResultSet rs, StatementContext ctx) throws SQLException {
	Person p = fillInFields(new Person(), rs);
	
	if (MapperUtils.containsColumnNamed(rs, "positions_id")) { 
		p.setPosition(PositionMapper.fillInFields(new Position(), rs));
	}
	
	if (MapperUtils.containsColumnNamed(rs, "totalCount")) { 
		ctx.setAttribute("totalCount", rs.getInt("totalCount"));
	}
	return p;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:14,代码来源:PersonMapper.java

示例6: map

import org.skife.jdbi.v2.StatementContext; //导入方法依赖的package包/类
@Override
public Report map(int index, ResultSet rs, StatementContext ctx) throws SQLException {
	Report r = new Report();
	r.setId(rs.getInt("reports_id"));
	
	r.setState(MapperUtils.getEnumIdx(rs, "reports_state", ReportState.class));
	r.setCreatedAt(new DateTime(rs.getTimestamp("reports_createdAt")));
	r.setUpdatedAt(new DateTime(rs.getTimestamp("reports_updatedAt")));
	
	Timestamp engagementDate = rs.getTimestamp("reports_engagementDate");
	if (engagementDate != null) { 
		r.setEngagementDate(new DateTime(engagementDate));
	}
	
	Timestamp releasedAt = rs.getTimestamp("reports_releasedAt");
	if (releasedAt != null) { 
		r.setReleasedAt(new DateTime(releasedAt));
	}
	
	Integer locationId = MapperUtils.getInteger(rs, "reports_locationId");
	if (locationId != null) { 
		Location l = Location.createWithId(locationId);
		r.setLocation(l);
	}
	
	Integer approvalStepId = MapperUtils.getInteger(rs, "reports_approvalStepId");
	if (approvalStepId != null) { 
		r.setApprovalStep(ApprovalStep.createWithId(approvalStepId));
	}
	
	r.setIntent(rs.getString("reports_intent"));
	r.setExsum(rs.getString("reports_exsum"));
	r.setAtmosphere(MapperUtils.getEnumIdx(rs, "reports_atmosphere", Atmosphere.class));
	r.setAtmosphereDetails(rs.getString("reports_atmosphereDetails"));
	r.setCancelledReason(MapperUtils.getEnumIdx(rs, "reports_cancelledReason", ReportCancelledReason.class));
	
	r.setReportText(rs.getString("reports_text"));
	r.setKeyOutcomes(rs.getString("reports_keyOutcomes"));
	r.setNextSteps(rs.getString("reports_nextSteps"));
	
	Person author = Person.createWithId((MapperUtils.getInteger(rs, "reports_authorId")));
	PersonMapper.fillInFields(author, rs);
	r.setAuthor(author);
	r.setLoadLevel(LoadLevel.PROPERTIES);
	
	Integer advisorOrgId = MapperUtils.getInteger(rs, "reports_advisorOrganizationId");
	if (advisorOrgId != null) { 
		r.setAdvisorOrg(Organization.createWithId(advisorOrgId));
	}
	
	Integer principalOrgId = MapperUtils.getInteger(rs, "reports_principalOrganizationId");
	if (principalOrgId != null) { 
		r.setPrincipalOrg(Organization.createWithId(principalOrgId));
	}
	
	if (MapperUtils.containsColumnNamed(rs, "totalCount")) { 
		ctx.setAttribute("totalCount", rs.getInt("totalCount"));
	}
	
	return r;
}
 
开发者ID:deptofdefense,项目名称:anet,代码行数:62,代码来源:ReportMapper.java


注:本文中的org.skife.jdbi.v2.StatementContext.setAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。