- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,请帮帮我。过去几天我一直在尝试解决这个问题,但没有成功。我正在尝试查询“Biljeska”对象并将它们作为 Biljeska 列表返回。类(class)设置:
Biljeznica.java:
@Entity
@Table(name = "biljeznica")
public class Biljeznica implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5589212916227508153L;
@Id
@Column(name= "naziv")
private String naziv;
@Column(name= "opis")
private String opis;
public Biljeznica(){}
// getters and setters
Korisnik.java:
@Entity
@Table(name = "user")
public class Korisnik extends NovaBiljeskaForm implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3476436475286629836L;
@Id
@Column(name= "id")
@GeneratedValue
private int id;
@Column(name= "ime")
private String ime;
@Column(name= "prezime")
private String prezime;
@Column(name= "username")
private String nick;
public Korisnik(){}
//getters and setters
Biljeska.java:
@Entity
@Table(name = "biljeska")
public class Biljeska implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3706596321179671012L;
@Id
@Column(name= "id")
@GeneratedValue
int id;
@Column(name = "naslov")
private String naslov;
@Column(name = "tekst")
private String tekst;
@ManyToOne (cascade = CascadeType.ALL)
@JoinColumn(name ="korisnik")
private Korisnik korisnik;
@ManyToOne (cascade = CascadeType.ALL)
@JoinColumn(name = "biljeznica")
private Biljeznica biljeznica;
public Biljeska(){}
h2 架构:
CREATE TABLE user (
id INT(11) IDENTITY PRIMARY KEY,
ime VARCHAR(50) NOT NULL,
prezime VARCHAR(50) NOT NULL,
username VARCHAR(45),
password VARCHAR(100) NOT NULL ,
enabled TINYINT NOT NULL DEFAULT 1
);
CREATE TABLE biljeznica (
naziv VARCHAR(50) PRIMARY KEY,
opis VARCHAR(100) NOT NULL
);
CREATE TABLE biljeska (
id INT(11) IDENTITY PRIMARY KEY,
naslov VARCHAR(100),
tekst VARCHAR(1000),
korisnik VARCHAR(45) NOT NULL,
biljeznica VARCHAR(50) NOT NULL,
FOREIGN KEY (korisnik) REFERENCES user (username),
FOREIGN KEY (biljeznica) REFERENCES biljeznica (naziv)
);
我通过 test-data.sql 插入模式的数据:
INSERT INTO user(ime, prezime,username,password,enabled)
VALUES ('Ivo','Ivić','iivic','$2a$10$VQoRdaQK0KzAl4QoBzfZleRBcHitGS5jRA771ilGdL2DvkVTLDqSe', true);
INSERT INTO user(ime, prezime,username,password,enabled)
VALUES ('Marko','Markić','mmarkic','$2a$10$VQoRdaQK0KzAl4QoBzfZleRBcHitGS5jRA771ilGdL2DvkVTLDqSe', true);
INSERT INTO user(ime, prezime,username,password,enabled)
VALUES ('Pero','Perić','pperic','$2a$10$VQoRdaQK0KzAl4QoBzfZleRBcHitGS5jRA771ilGdL2DvkVTLDqSe', true);
INSERT INTO user(ime, prezime,username,password,enabled)
VALUES ('Adminko','Adminić','admin','$2a$10$VQoRdaQK0KzAl4QoBzfZleRBcHitGS5jRA771ilGdL2DvkVTLDqSe', true);
INSERT INTO user_role (username, role)
VALUES ('iivic', 'ROLE_USER');
INSERT INTO user_role (username, role)
VALUES ('mmarkic', 'ROLE_USER');
INSERT INTO user_role (username, role)
VALUES ('pperic', 'ROLE_USER');
INSERT INTO user_role (username, role)
VALUES ('admin', 'ROLE_USER');
INSERT INTO user_role (username, role)
VALUES ('admin', 'ROLE_ADMIN');
INSERT INTO biljeznica(naziv, opis)
VALUES('Web aplikacije u Javi', 'Bilješke s predavanja iz kolegija web aplikacije u
Javi');
INSERT INTO biljeznica(naziv, opis)
VALUES('Razvoj aplikacija na Android platformi', 'Bilješke s predavanja kolegija razvoj
aplikacija na Android platformi');
INSERT INTO biljeznica(naziv, opis)
VALUES('Napredne teme računalnih mreža', 'Bilješke s predavanja napredne teme
računalnih mreža');
INSERT INTO biljeska(naslov, tekst, korisnik, biljeznica)
VALUES('Testni naslov', 'Testni tekst', 'iivic', 'Web aplikacije u Javi');
INSERT INTO biljeska(naslov, tekst, korisnik, biljeznica)
VALUES('Moj naslov', 'Moj tekst', 'pperic', 'Web aplikacije u Javi');
我想要返回 Biljeska 对象列表的存储库类中的方法:
@Autowired
public HibernateBiljeskaRepository(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
private Session currentSession() {
return sessionFactory.getCurrentSession();
}
public List<Biljeska> findAll() {
return currentSession().createQuery("select b from Biljeska b, Biljeznica bi, Korisnik k where b.korisnik = k and b.biljeznica = bi",Biljeska.class).getResultList();
}
findAll()方法返回语句出现异常
我收到的错误消息:
Apr 28, 2017 1:19:01 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 22018, SQLState: 22018
Apr 28, 2017 1:19:01 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Data conversion error converting "iivic"; SQL statement:
select biljeska0_.id as id1_0_, biljeska0_.biljeznica as biljezni4_0_, biljeska0_.korisnik as korisnik5_0_, biljeska0_.naslov as naslov2_0_, biljeska0_.tekst as tekst3_0_ from biljeska biljeska0_ cross join biljeznica biljeznica1_ cross join user korisnik2_ where biljeska0_.korisnik=korisnik2_.id and biljeska0_.biljeznica=biljeznica1_.naziv [22018-193]
Apr 28, 2017 1:19:01 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/labos1] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not extract ResultSet] with root cause
java.lang.NumberFormatException: For input string: "iivic"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at org.h2.value.Value.convertTo(Value.java:922)
at org.h2.mvstore.db.MVPrimaryIndex.getKey(MVPrimaryIndex.java:338)
at org.h2.mvstore.db.MVDelegateIndex.find(MVDelegateIndex.java:69)
at org.h2.index.BaseIndex.find(BaseIndex.java:128)
at org.h2.index.IndexCursor.find(IndexCursor.java:169)
at org.h2.table.TableFilter.next(TableFilter.java:467)
at org.h2.table.TableFilter.next(TableFilter.java:537)
at org.h2.command.dml.Select.queryFlat(Select.java:542)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:655)
at org.h2.command.dml.Query.query(Query.java:341)
at org.h2.command.dml.Query.query(Query.java:309)
at org.h2.command.dml.Query.query(Query.java:36)
at org.h2.command.CommandContainer.query(CommandContainer.java:110)
at org.h2.command.Command.executeQuery(Command.java:201)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:110)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:71)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2123)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887)
at org.hibernate.loader.Loader.doQuery(Loader.java:932)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
at org.hibernate.loader.Loader.doList(Loader.java:2615)
at org.hibernate.loader.Loader.doList(Loader.java:2598)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2430)
at org.hibernate.loader.Loader.list(Loader.java:2425)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:375)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1481)
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1441)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1410)
at org.hibernate.query.Query.getResultList(Query.java:146)
at hr.tvz.hibernate.HibernateBiljeskaRepository.findAll(HibernateBiljeskaRepository.java:58)
at hr.tvz.hibernate.HibernateBiljeskaRepository$$FastClassBySpringCGLIB$$d420114f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
at hr.tvz.hibernate.HibernateBiljeskaRepository$$EnhancerBySpringCGLIB$$d7521f20.findAll(<generated>)
at hr.tvz.controleri.NovaBiljeskaController.showSpremljeneBiljeske(NovaBiljeskaController.java:215)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
我真的很困惑,我不明白为什么我会收到这个错误......预先感谢您!
编辑:
感谢亚历克斯解决了
解决方案:将Biljeska属性更改为
@ManyToOne (fetch = FetchType.EAGER)
@JoinColumn(name ="korisnik", referencedColumnName="username")
private Korisnik korisnik;
@ManyToOne (fetch = FetchType.EAGER)
@JoinColumn(name = "biljeznica", referencedColumnName="naziv")
private Biljeznica biljeznica;
并将 hql 发送至:
"select b from Biljeska b"
最佳答案
在 SQL 代码中,您将 biljeska.korisnik
设为 user.username
的外键。但在 Java 代码中,您没有指定外键引用的是 Korisnik
类的哪一列,因此它试图引用主键,它是一个整数,这就是为什么您得到 NumberFormatException
。
您必须在 Biljeska.korisnik
中使用 JoinColumn.referencedColumnName
来引用 username
列。
关于java - HQL java.lang.NumberFormatException : For input string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43669502/
我正在尝试使用 Integer.parseInt(simNumber) 将 String 转换为 int,但我收到错误消息。如何将 String 转换为 int?我在网上搜索了一下,找到了Intege
每次我尝试启动我的代码时,我总是遇到同样的错误: java.lang.NumberFormatException: For input string: "x" at java.lang.Numbe
在检查我的错误处理代码时偶然发现了这个。当您调用 Integer.parseInt(null) 时,Java 抛出 NumberFormatException 而 Float.parseFloat(n
如果有人可以看看我在 Selenium 方面遇到的问题。我尝试使用以下方法访问上述计算器中的结果: public String getAttributeValue(WebElement element
嗯,我很无聊,所以我想做一个二进制>十进制转换器。我将转换器的上限设置为 30 位数字 (1073741823) 或 (0111111111111111111111111111111)。我遇到的问题是
在以下代码中,Clojure (1.2) 打印出错误消息: (try (let [value "1,a"] (map #(Integer/parseInt %) (.split value
String str="123456.7855456677"; ParsePosition parsePosition = new ParsePosition(0); NumberFormat num
代码: String myVar = "1255763710960"; int myTempVar=0; try { myTempVar = Integer.valueOf(myVar); }
我在NumberFormatException代码中收到Grails错误,该错误是将电影分类到数据库中。该错误表明它来自cron插件。我已经完成了研究,并且一直在尝试使用NumberFormatExc
我在将字符串解析为原语时遇到问题。 File file1 = new File("bankData.txt"); Scanner sc = new Scanner(fi
所以我试图从日期列表中查找最新日期,但我不断收到 NumberFormatException。有什么办法可以解决这个问题吗? import java.util.*; public class Date
如果使用变量 bin1 它不会转换,但是如果我用 bin2 替换参数,它似乎可以工作。 我尝试使用 long 而不是 int。还是一样。 public class Test{ public s
我正在尝试找出如何在代码中捕获数字格式异常错误,这样如果用户在字符串中输入字母并且我的程序尝试将其解析为 int 我的程序将不会抛出错误而是停止并返回一个 boolean 值。我还试图了解,如果 tr
该程序的本质目的是将学生信息写入文件并从同一文件中读取。该程序包括一个 if 语句,用于判断学生是否处于良好信誉或留校察看状态,每个语句都有各自的文件(goodstand.txt 和 probatio
我正在用 Python/WLST 编写代码,以自动连接、启动和停止 weblogic 中的托管服务器。当我启动 Python 时,出现以下错误。 异常的含义是什么?我该如何解决它? Initializ
这是我的代码: public void setAreaAccessPoints(){ String mac = "",essid = "",status = ""; int stre
我正在用 Java 开发一个应用程序,发现了这个奇怪的行为: 如果通过控制面板将区域设置格式设置为匈牙利语(系统默认值),我会收到此异常,但如果我将其设置为英语格式,则它可以正常工作。也适用于虚拟 M
我正在尝试制作一个计算器应用程序,但不幸的是我无法解析字符串。 应用程序接受输入并将其显示在 EditText et2 中。当按下“等于”键时,计算器将执行以下工作。 et2 = (EditText)
我有一个文件,其中包含许多电影标题及其年份、5 星评级和长度。我正在尝试读取该文件并将标题、年份、评级和长度存储为变量。我遇到的问题是在我的检索年份的代码中。该代码可以编译,但在运行时,当它到达具有多
我正在解决亚马逊 Interview Street 网站上的 Connected Sets 问题 https://amazon.interviewstreet.com/challenges我的代码对于
我是一名优秀的程序员,十分优秀!