@Test public void testGetCriteria() { context.checking(new Expectations() { { oneOf(hibernateSession).createCriteria(Person.class); } }); Criteria result = sut.getCriteria(hibernateSession); assertNotNull(result); context.assertIsSatisfied(); }
public Criteria getCriteria(final Session hibernateSession) { Criteria criteria = hibernateSession.createCriteria(Person.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("dateAdded")); fields.add(getColumn("accountId")); fields.add(getColumn("openSocialId")); fields.add(getColumn("avatarId")); fields.add(getColumn("avatarCropX")); fields.add(getColumn("avatarCropY")); fields.add(getColumn("avatarCropSize")); fields.add(getColumn("lastName")); fields.add(getColumn("displayNameSuffix")); fields.add(getColumn("displayName")); fields.add(getColumn("preferredName")); fields.add(getColumn("jobDescription")); fields.add(getColumn("title")); fields.add(getColumn("overview")); fields.add(getColumn("followersCount")); fields.add(getColumn("followingCount")); fields.add(getColumn("groupsCount")); fields.add(getColumn("optOutVideoIds")); fields.add(getColumn("updatesCount")); fields.add(getColumn("email")); fields.add(getColumn("commentable")); fields.add(getColumn("companyName")); fields.add(getColumn("streamPostable")); fields.add(getColumn("additionalProperties")); fields.add(getColumn("groupStreamHiddenLineIndex")); fields.add(getColumn("lastAcceptedTermsOfService")); fields.add(getColumn("accountLocked")); fields.add(getColumn("accountDeactivated")); fields.add(getColumn("workPhone")); fields.add(getColumn("cellPhone")); fields.add(getColumn("fax")); fields.add(Projections.property("streamViewHiddenLineIndex").as("compositeStreamHiddenLineIndex")); fields.add(Projections.property("stream.id").as("streamId")); criteria.setProjection(fields); criteria.createAlias("streamScope", "stream"); ModelViewResultTransformer<PersonModelView> resultTransformer = new ModelViewResultTransformer<PersonModelView>( new PersonModelViewFactory()); criteria.setResultTransformer(resultTransformer); return criteria; }
PersonQueryStrategy { public Criteria getCriteria(final Session hibernateSession) { Criteria criteria = hibernateSession.createCriteria(Person.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("dateAdded")); fields.add(getColumn("accountId")); fields.add(getColumn("openSocialId")); fields.add(getColumn("avatarId")); fields.add(getColumn("avatarCropX")); fields.add(getColumn("avatarCropY")); fields.add(getColumn("avatarCropSize")); fields.add(getColumn("lastName")); fields.add(getColumn("displayNameSuffix")); fields.add(getColumn("displayName")); fields.add(getColumn("preferredName")); fields.add(getColumn("jobDescription")); fields.add(getColumn("title")); fields.add(getColumn("overview")); fields.add(getColumn("followersCount")); fields.add(getColumn("followingCount")); fields.add(getColumn("groupsCount")); fields.add(getColumn("optOutVideoIds")); fields.add(getColumn("updatesCount")); fields.add(getColumn("email")); fields.add(getColumn("commentable")); fields.add(getColumn("companyName")); fields.add(getColumn("streamPostable")); fields.add(getColumn("additionalProperties")); fields.add(getColumn("groupStreamHiddenLineIndex")); fields.add(getColumn("lastAcceptedTermsOfService")); fields.add(getColumn("accountLocked")); fields.add(getColumn("accountDeactivated")); fields.add(getColumn("workPhone")); fields.add(getColumn("cellPhone")); fields.add(getColumn("fax")); fields.add(Projections.property("streamViewHiddenLineIndex").as("compositeStreamHiddenLineIndex")); fields.add(Projections.property("stream.id").as("streamId")); criteria.setProjection(fields); criteria.createAlias("streamScope", "stream"); ModelViewResultTransformer<PersonModelView> resultTransformer = new ModelViewResultTransformer<PersonModelView>( new PersonModelViewFactory()); criteria.setResultTransformer(resultTransformer); return criteria; } }
PersonQueryStrategy { public Criteria getCriteria(final Session hibernateSession) { Criteria criteria = hibernateSession.createCriteria(Person.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("dateAdded")); fields.add(getColumn("accountId")); fields.add(getColumn("openSocialId")); fields.add(getColumn("avatarId")); fields.add(getColumn("avatarCropX")); fields.add(getColumn("avatarCropY")); fields.add(getColumn("avatarCropSize")); fields.add(getColumn("lastName")); fields.add(getColumn("displayNameSuffix")); fields.add(getColumn("displayName")); fields.add(getColumn("preferredName")); fields.add(getColumn("jobDescription")); fields.add(getColumn("title")); fields.add(getColumn("overview")); fields.add(getColumn("followersCount")); fields.add(getColumn("followingCount")); fields.add(getColumn("groupsCount")); fields.add(getColumn("optOutVideoIds")); fields.add(getColumn("updatesCount")); fields.add(getColumn("email")); fields.add(getColumn("commentable")); fields.add(getColumn("companyName")); fields.add(getColumn("streamPostable")); fields.add(getColumn("additionalProperties")); fields.add(getColumn("groupStreamHiddenLineIndex")); fields.add(getColumn("lastAcceptedTermsOfService")); fields.add(getColumn("accountLocked")); fields.add(getColumn("accountDeactivated")); fields.add(getColumn("workPhone")); fields.add(getColumn("cellPhone")); fields.add(getColumn("fax")); fields.add(Projections.property("streamViewHiddenLineIndex").as("compositeStreamHiddenLineIndex")); fields.add(Projections.property("stream.id").as("streamId")); criteria.setProjection(fields); criteria.createAlias("streamScope", "stream"); ModelViewResultTransformer<PersonModelView> resultTransformer = new ModelViewResultTransformer<PersonModelView>( new PersonModelViewFactory()); criteria.setResultTransformer(resultTransformer); return criteria; }  }
PersonQueryStrategy { public Criteria getCriteria(final Session hibernateSession) { Criteria criteria = hibernateSession.createCriteria(Person.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("dateAdded")); fields.add(getColumn("accountId")); fields.add(getColumn("openSocialId")); fields.add(getColumn("avatarId")); fields.add(getColumn("avatarCropX")); fields.add(getColumn("avatarCropY")); fields.add(getColumn("avatarCropSize")); fields.add(getColumn("lastName")); fields.add(getColumn("displayNameSuffix")); fields.add(getColumn("displayName")); fields.add(getColumn("preferredName")); fields.add(getColumn("jobDescription")); fields.add(getColumn("title")); fields.add(getColumn("overview")); fields.add(getColumn("followersCount")); fields.add(getColumn("followingCount")); fields.add(getColumn("groupsCount")); fields.add(getColumn("optOutVideoIds")); fields.add(getColumn("updatesCount")); fields.add(getColumn("email")); fields.add(getColumn("commentable")); fields.add(getColumn("companyName")); fields.add(getColumn("streamPostable")); fields.add(getColumn("additionalProperties")); fields.add(getColumn("groupStreamHiddenLineIndex")); fields.add(getColumn("lastAcceptedTermsOfService")); fields.add(getColumn("accountLocked")); fields.add(getColumn("accountDeactivated")); fields.add(getColumn("workPhone")); fields.add(getColumn("cellPhone")); fields.add(getColumn("fax")); fields.add(Projections.property("streamViewHiddenLineIndex").as("compositeStreamHiddenLineIndex")); fields.add(Projections.property("stream.id").as("streamId")); criteria.setProjection(fields); criteria.createAlias("streamScope", "stream"); ModelViewResultTransformer<PersonModelView> resultTransformer = new ModelViewResultTransformer<PersonModelView>( new PersonModelViewFactory()); criteria.setResultTransformer(resultTransformer); return criteria; }  Criteria getCriteria(final Session hibernateSession); }
PersonQueryStrategy { public Criteria getCriteria(final Session hibernateSession) { Criteria criteria = hibernateSession.createCriteria(Person.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("dateAdded")); fields.add(getColumn("accountId")); fields.add(getColumn("openSocialId")); fields.add(getColumn("avatarId")); fields.add(getColumn("avatarCropX")); fields.add(getColumn("avatarCropY")); fields.add(getColumn("avatarCropSize")); fields.add(getColumn("lastName")); fields.add(getColumn("displayNameSuffix")); fields.add(getColumn("displayName")); fields.add(getColumn("preferredName")); fields.add(getColumn("jobDescription")); fields.add(getColumn("title")); fields.add(getColumn("overview")); fields.add(getColumn("followersCount")); fields.add(getColumn("followingCount")); fields.add(getColumn("groupsCount")); fields.add(getColumn("optOutVideoIds")); fields.add(getColumn("updatesCount")); fields.add(getColumn("email")); fields.add(getColumn("commentable")); fields.add(getColumn("companyName")); fields.add(getColumn("streamPostable")); fields.add(getColumn("additionalProperties")); fields.add(getColumn("groupStreamHiddenLineIndex")); fields.add(getColumn("lastAcceptedTermsOfService")); fields.add(getColumn("accountLocked")); fields.add(getColumn("accountDeactivated")); fields.add(getColumn("workPhone")); fields.add(getColumn("cellPhone")); fields.add(getColumn("fax")); fields.add(Projections.property("streamViewHiddenLineIndex").as("compositeStreamHiddenLineIndex")); fields.add(Projections.property("stream.id").as("streamId")); criteria.setProjection(fields); criteria.createAlias("streamScope", "stream"); ModelViewResultTransformer<PersonModelView> resultTransformer = new ModelViewResultTransformer<PersonModelView>( new PersonModelViewFactory()); criteria.setResultTransformer(resultTransformer); return criteria; }  Criteria getCriteria(final Session hibernateSession);  }